<!--
   *@description: 工程节点信息dialog
   *@author: yh Fu
   *@date: 2024-01-03 14:27:02
   *@version: V1.0.5
-->


<template>
  <div style="width: 100%; height: 100%;">
    <el-dialog :visible="nodeDetailVisible" :rules="nodeRules" title="节点信息" append-to-body
               customClass="appendElNodeDialog" width="70% !important">
      <!-- 节点选项卡 -->
      <el-tabs type="border-card" class="engineNodeTypes" @tab-click="nodeHasChanged" :before-leave="confirmLeave"
               v-model="tabsModel">
        <!-- <el-tab-pane label="基本信息"></el-tab-pane> -->
        <el-tab-pane
          :label="e"
          v-for="e in currentNode"
          :key="e"
          :name="e"
        >
        </el-tab-pane>
      </el-tabs>
      <!-- 节点表单 -->
      <el-form ref="nodeForm" :model="zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
        <!-- <el-form-item label="节点类型" prop="type">
         <el-select v-model="nodeType" placeholder="请选择节点类型">
              <el-option
                v-for="e in dict.type.engineering_infrastructure"
                :key="e.value"
                :label="e.label"
                :value="e.value"
                ></el-option>
          </el-select>
        </el-form-item> -->
        <!-- <el-form-item label="工程类型" prop="enginType">
          <el-select
              v-model="currentEnginType"
              placeholder="请选择工程类型"
              @change="enginTypeHasChanged"
              >
            <el-option
              v-for="e in enginTypeOption"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            ></el-option>
          </el-select>
        </el-form-item> -->
        <!-- <el-form-item label="工程类型">
            <el-cascader
                v-model="value"
                :options="options"
                @change="currentEnginTypeChange">
            </el-cascader>
          </el-form-item> -->
        <!-- <el-form-item label="工程节点">
          <el-select
              v-model="enginClassification"
              placeholder="请选择工程节点"
              >
            <el-option
              v-for="e in enginClassificationOption"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            ></el-option>
          </el-select>
        </el-form-item> -->
        <el-form-item label="施工地址" prop="constructAddre">
          <el-input v-model="zEngineeringInfoBo.constructAddre" placeholder="请填写施工地址"
                    :disabled="formType"></el-input>
        </el-form-item>
        <el-form-item label="施工人电话" prop="constructPhone">
          <el-input v-model="zEngineeringInfoBo.constructPhone" placeholder="请填写施工人电话"
                    :disabled="formType"></el-input>
        </el-form-item>
        <el-form-item label="施工人" prop="constructUser">
          <el-input v-model="zEngineeringInfoBo.constructUser" placeholder="请填写施工人"
                    :disabled="formType"></el-input>
        </el-form-item>
        <!-- <el-form-item label="负责人" prop="headName">
        <el-input v-model="zEngineeringInfoBo.headName" placeholder="请填写负责人"></el-input>
        </el-form-item> -->
        <el-form-item label="负责人电话" prop="headPhone">
          <el-input v-model="zEngineeringInfoBo.headPhone" placeholder="请填写负责人电话"
                    :disabled="formType"></el-input>
        </el-form-item>
        <el-form-item label="回填时间" prop="backfillTime">
          <el-date-picker
            :disabled="formType"
            v-model="zEngineeringInfoBo.backfillTime"
            value-format="yyyy-MM-dd hh:mm:ss"
            type="datetime"
            placeholder="请选择回填日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="施工时间" prop="constructTime">
          <el-date-picker
            :disabled="formType"
            v-model="zEngineeringInfoBo.constructTime"
            value-format="yyyy-MM-dd hh:mm:ss"
            type="datetime"
            placeholder="请选择施工时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="是否按图纸施工" prop="constructAccordingDrawings">
          <el-select v-model="zEngineeringInfoBo.constructAccordingDrawings" :disabled="formType">
            <el-option
              v-for="e in constructAccordingDrawingsOption"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="分段打压" prop="segmentedCompressionQualified">
          <el-select v-model="zEngineeringInfoBo.segmentedCompressionQualified" :disabled="formType">
            <el-option
              v-for="e in segmentedCompressionQualifiedOption"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
          <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']"
                          :value="zEngineeringInfoBo.zEngiineeringPhotoBoList"
                          @input="getUrl"></ObsImageUpload>
        </el-form-item>
        <!-- 节点复选框 -->
        <el-checkbox-group v-model="currentNode" @change="currentNodeHasChanged">
          <el-checkbox
            :label="e.name"
            v-for="e in nodeList"
            :key="e.name"
          ></el-checkbox>
        </el-checkbox-group>
        <div style="display: flex;margin-top: 3%;">
          <div style="width: 80%;"></div>
          <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
          <el-button type="primary" @click="addMaterial">添加用料单</el-button>
          <el-button @click="nodeCancel">取 消</el-button>
        </div>
      </el-form>
    </el-dialog>

    <el-drawer
      title="用料单"
      :visible.sync="drawer"
      :direction="direction"
      :before-close="null">
      <el-form ref="materialForm" :model="zEngineeringMaterialBoIO" :rules="materialRules" label-width="110px">
        <el-form-item label="腐蚀等级" prop="corrosionLevel">
          <el-select v-model="zEngineeringMaterialBoIO.corrosionLevel">
            <el-option
              v-for="e in dict.type.corrosion_level"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="品牌" prop="brand">
          <el-select v-model="zEngineeringMaterialBoIO.brand">
            <el-option
              v-for="e in dict.type.brand"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="上门类型" prop="visitType">
          <el-select v-model="zEngineeringMaterialBoIO.visitType">
            <el-option
              v-for="e in dict.type.visit_type"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="自闭阀类型" prop="selfClosingValveType">
          <el-select v-model="zEngineeringMaterialBoIO.selfClosingValveType">
            <el-option
              v-for="e in dict.type.self_closing_valve_type"
              :key="e.value"
              :label="e.label"
              :value="e.value"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </el-drawer>
  </div>
</template>

<script>
import {
  addEnginee,                                // 新增工业工程
  addEngineeringPipeJacking,                 // 新增顶管工程
  putEngineeringPipeJacking,                 // 修改顶管工程
  getEnginMaterialQualityList,               // 获取工程材质
  addEngineeringCivil,                       // 新增民用工程
  addEngineeringInfrastructure,              // 新增基建工程
  putEngineeringCivil,                       // 民用修改
  putEngineeringInfrastructure,              // 基建修改
} from "@/api/zdsz/enginee"
import {updateEngineeringDangerous, addEngineeringDangerous} from "@/api/zdsz/engineeringDangerous";

export default {
  name: 'EngineeNode',
  dicts: ['pass_check',
    'is_repair',
    'engin_type',
    'self_closing_valve_type',
    'visit_type',
    'corrosion_level',
    'brand',
    'engineering_infrastructure',
    'old_renovation',
    'new_built'
  ],
  data() {
    return {
      nodeType: null,              // 节点类型
      params: {},                  // 所有参数集合
      nodeDetailVisible: false,
      buttonLoading: false,
      // 节点规则校验
      nodeRules: {
        type: [
          {required: true, message: "施工地址不能为空", trigger: 'blur'}
        ],
        constructAddre: [
          {required: true, message: "施工地址不能为空", trigger: 'blur'}
        ],
        constructPhone: [
          {required: true, message: "施工人电话不能为空", trigger: 'blur'}
        ],
        constructUser: [
          {required: true, message: "施工人不能为空", trigger: 'blur'}
        ],
        headName: [
          {required: true, message: "负责人不能为空", trigger: 'blur'}
        ],
        headPhone: [
          {required: true, message: "负责人电话不能为空", trigger: 'blur'}
        ],

      },
      zEngineeringInfoBo: {
        constructAddre: '',        // 施工地址
        constructPhone: '',        // 施工人电话
        constructUser: '',         // 施工人
        headName: '',              // 负责人
        headPhone: '',             // 负责人电话
        constructAccordingDrawings: '', // 是否按图纸施工
        segmentedCompressionQualified: '', // 分段打压是否合格
        backfillTime: '',                  // 回填时间
        constructTime: '',                  // 施工时间
        zEngiineeringPhotoBoList: [],              // 图片列表
        zEngineeringMaterialBo: [],// 用料对象

      },                          // 节点信息
      constructAccordingDrawingsOption: [
        {
          value: '1',
          label: '是'
        },
        {
          value: '0',
          label: '否'
        }
      ],
      segmentedCompressionQualifiedOption: [
        {
          value: '1',
          label: '合格'
        },
        {
          value: '0',
          label: '不合格'
        }
      ],
      currentEnginType: '',        // 当前所选工程类型
      enginTypeOption: [
        {
          value: 'old_renovation',
          label: '旧改'
        },
        {
          value: 'new_built',
          label: '新建'
        }
      ],
      options: [
        {
          value: 'old_renovation',
          label: '旧改',
          children: [],
        },
        {
          value: 'new_built',
          label: '新增',
          children: []
        }
      ],
      enginClassification: '',
      enginClassificationOption: [],
      currentType: null,          // 民用工程 0 ,市政工程 1,工业工程 2 ,顶管工程 3,危险作业工程 4,基建工程 5
      drawer: false,
      direction: 'rtl',
      materialRules: [],
      zEngineeringMaterialBoIO: {
        corrosionLevel: null,            // 腐蚀等级
        brand: null,                     // 品牌
        visitType: '',                   // 上门类型
        selfClosingValveType: '',        // 自闭阀类型
      },
      beforeNodeName: null,          // 上一个所选的节点全名称
      currentNode: [],
      nodeList: [],
      currentPickedNode: {},        // 当前所选中的节点界面
      zEngineeringNodeBoList: [],                            // 节点信息大集合
      tabsModel: "",
      formType: false
    }
  },
  created() {
    this.options[0].children = this.dict.type.old_renovation
    this.options[1].children = this.dict.type.new_built
  },
  methods: {
    confirmLeave() {
      console.log(this.zEngineeringNodeBoList)
      if (this.currentType == '16') return true
      let p = new Promise((resolve, reject) => {
        this.$refs.nodeForm.validate(e => {
          e ? resolve() : reject();
          if (e) {
            this.$message({
              message: '保存成功',
              type: 'success'
            });
            return true
          } else {
            this.$message({
              message: '请完善当前节点信息',
              type: 'error'
            });
            return false
          }
        })
      });
      return p;
    },
    nodeHasChanged(el) {
      if (el.label == this.beforeNodeName) return
      if (this.currentType == '16') {
        // console.log('_______',currentNodeInfo)
        // this.beforeNodeName = this.zEngineeringNodeBoList[currentNodeInfoIndex].name
        const currentNodeInfo = this.zEngineeringNodeBoList.find(e => el.label == e.name)
        const currentNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => el.label == e.name)
        // todo: 将当前tab页所选节点信息录入
        this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
        // console.log('_______',this.zEngineeringInfoBo)

      } else {
        // todo: 校验当前表单
        this.$refs.nodeForm.validate(e => {
          if (e) {
            this.$message({
              message: '保存成功',
              type: 'sucess'
            });
            // todo: 将当前的节点信息录入到大集合中
            if (this.beforeNodeName != null) {
              const beforeNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => this.beforeNodeName == e.name)
              this.zEngineeringNodeBoList[beforeNodeInfoIndex].zEngineeringInfoBo = this.zEngineeringInfoBo
            }
            // end
            const currentNodeInfo = this.zEngineeringNodeBoList.find(e => el.label == e.name)
            const currentNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => el.label == e.name)
            // todo: 将当前tab页所选节点信息录入
            this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
            this.beforeNodeName = this.zEngineeringNodeBoList[currentNodeInfoIndex].name
            console.log('节点信息大集合', this.zEngineeringNodeBoList)
          } else {
            this.$message({
              message: '请完善当前节点信息',
              type: 'warning'
            });
          }
        })
      }

      return
      // 拿到当前所选择的节点info
      const nodeItem = this.dict.type.engineering_infrastructure.find(e => e.label == this.currentNode[el.index - 1])
      this.currentPickedNode = nodeItem
      console.log(nodeItem)
    },
    // 当前所选节点发生改变
    currentNodeHasChanged(e) {
      const currentName = e[e.length - 1]
      const currentNodeInfo = this.nodeList.find(e => e.name == currentName)
      // todo: 填入节点大集合
      this.zEngineeringNodeBoList.push({
        type: currentNodeInfo.value,
        validateFlag: null,                   // 校验当前集合是否通过标识
        name: currentNodeInfo.name,           // 节点完整名称
        zEngineeringInfoBo: {
          constructAddre: '',                 // 施工地址
          constructPhone: '',                 // 施工人电话
          constructUser: '',                  // 施工人
          headName: '',                       // 负责人
          headPhone: '',                      // 负责人电话
          constructAccordingDrawings: '',     // 是否按图纸施工
          segmentedCompressionQualified: '',  // 分段打压是否合格
          backfillTime: '',                   // 回填时间
          constructTime: '',                  // 施工时间
          zEngiineeringPhotoBoList: [],              // 图片列表
          zEngineeringMaterialBo: [],         // 用料对象
        }
      })
      console.log('节点信息大集合', this.zEngineeringNodeBoList)
    },
    // 添加用料
    addMaterial() {
      this.drawer = true
    },
    getUrl(url) {
      this.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
    },
    nodeCancel() {
      this.nodeType = null
      this.reset()
      this.nodeDetailVisible = false
    },
    created() {
      this.params = this.queryParams
    },
    // 提交表单 创建新工程

    submitForm() {
      this.buttonLoading = true
      this.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
      console.log(this.currentType)
      // this.$refs["nodeForm"].validate(valid => {
      // if (valid) {
      this.zEngineeringInfoBo.zEngineeringMaterialBo.push(this.zEngineeringMaterialBoIO)
      switch (this.currentType) {
        case 0 :
          // 民用工程 新增
          console.log('节点信息大集合', this.zEngineeringNodeBoList)
          console.log('节点option', this.nodeList)
          // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          this.params.zEngineeringNodeBoList = []
          this.zEngineeringNodeBoList.forEach(e => {
            this.params.zEngineeringNodeBoList.push({
              type: e.type,
              zEngineeringInfoBo: e.zEngineeringInfoBo
            })
          })
          this.params.enginType = this.nodeList[0].enginType
          this.params.enginClassification = this.nodeList[0].enginClassification
          addEngineeringCivil(this.params).then(res => {
            if (res.code == 200) {
              this.$message({
                message: '新增成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
        case 3 :
          // 危险作业工程新增
          this.params.zEngineeringNodeBo = {}
          this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          this.params.zEngineeringNodeBo.type = this.nodeType
          this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
          console.log(this.params)
          addEngineeringDangerous(this.params).then(res => {
            if (res.code == 200) {
              this.$message({
                message: '新增成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
        case 4 :
          // 基建工程新增
          this.params.zEngineeringNodeBoList = []
          this.zEngineeringNodeBoList.forEach(e => {
            this.params.zEngineeringNodeBoList.push({
              type: e.type,
              zEngineeringInfoBo: e.zEngineeringInfoBo
            })
          })


          // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          // this.params.zEngineeringNodeBo.type = this.nodeType
          // this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
          addEngineeringInfrastructure(this.params).then(res => {
            if (res.code == 200) {
              this.$message({
                message: '新增成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
        case 10 :
          // 顶管新增
          //   this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          // debugger
          //   addEngineeringPipeJacking(this.params).then(res => {
          //     if(res.code == 200){
          //       this.$message({
          //         message: '新增成功',
          //         type: 'success'
          //       });
          //       this.$emit('closeToSucceed')
          //       this.nodeDetailVisible = false
          //     }
          //   })


          // 民用工程 新增
          console.log('节点信息大集合', this.zEngineeringNodeBoList)
          console.log('节点option', this.nodeList)
          // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          this.params.zEngineeringNodeBoList = []
          this.zEngineeringNodeBoList.forEach(e => {
            this.params.zEngineeringNodeBoList.push({
              type: e.type,
              zEngineeringInfoBo: e.zEngineeringInfoBo
            })
          })
          this.params.enginType = this.nodeList[0].enginType
          this.params.enginClassification = this.nodeList[0].enginClassification
          addEngineeringPipeJacking(this.params).then(res => {
            if (res.code == 200) {
              this.$message({
                message: '新增成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
        case 14 :
          // 基建修改
          this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          putEngineeringInfrastructure(this.params).then(res => {
            console.log('________', res)
            if (res.code == 200) {
              this.$message({
                message: '修改成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
        case 15 :
          // 顶管修改
          this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          putEngineeringPipeJacking(this.params).then(res => {
            console.log('________', res)
            if (res.code == 200) {
              this.$message({
                message: '修改成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
        case 16 :
          // 民用修改
          this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          putEngineeringCivil(this.params).then(res => {
            console.log('民用________', res)
            if (res.code == 200) {
              this.$message({
                message: '修改成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;

        case 37:
          // 危险修改
          this.params.zEngineeringNodeBo = {}
          this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
          this.params.zEngineeringNodeBo.type = this.nodeType
          this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
          updateEngineeringDangerous(this.params).then(res => {
            if (res.code == 200) {
              this.$message({
                message: '修改成功',
                type: 'success'
              });
              this.$emit('closeToSucceed')
              this.nodeDetailVisible = false
            }
          })
          break;
      }
      // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
      // console.log(this.queryParams)
      // addEnginee(this.queryParams).then(res => {
      //     console.log(res)
      // })
      // }
      // });
      this.buttonLoading = false
    },
    open(queryParams, type = null, nodeOptions = []) {
      this.formType = false
      this.nodeList = []
      this.currentNode = []
      this.zEngineeringNodeBoList = []
      console.log(queryParams)
      console.log(nodeOptions)
      if (type == 16) {
        this.formType = true
        this.nodeList = nodeOptions // 节点初始化
        queryParams.zEngineeringNodeBoList.forEach(e => {
          // todo: 取出已添加节点回显
          let currentNodeName = nodeOptions.find(i => i.label == e.type).name
          let currentNodeValue = nodeOptions.find(i => i.label == e.type).value
          e.name = currentNodeName
          this.currentNode.push(currentNodeName)
          // 回显当前已添加节点
          console.log(e)
          // this.zEngineeringNodeBoList.push(e.zEngineeringInfoBoList[0])
          this.zEngineeringNodeBoList.push({
            type: currentNodeValue,
            validateFlag: null,                                                  // 校验当前集合是否通过标识
            name: e.name,                                                        // 节点完整名称
            zEngineeringInfoBo: e.zEngineeringInfoBoList[0]
          })
        })
        console.log('修改——————————', this.zEngineeringNodeBoList)
        // 当前tab页签所选中得节点
        this.tabsModel = nodeOptions[0].name
        // 记录当前节点页签
        this.beforeNodeName = this.currentNode[0]
        this.zEngineeringInfoBo = this.zEngineeringNodeBoList[0].zEngineeringInfoBo
      } else {
        this.nodeList = nodeOptions // 节点初始化
        console.log('节点option', this.nodeList)
        this.currentNode.push(nodeOptions[0].name)        // tab页默认选中第一条节点
        console.log(nodeOptions[0])
        this.beforeNodeName = nodeOptions[0].name
        this.zEngineeringNodeBoList.push({
          type: nodeOptions[0].value,
          validateFlag: null,                   // 校验当前集合是否通过标识
          name: nodeOptions[0].name,            // 节点完整名称
          zEngineeringInfoBo: {
            constructAddre: '',                 // 施工地址
            constructPhone: '',                 // 施工人电话
            constructUser: '',                  // 施工人
            headName: '',                       // 负责人
            headPhone: '',                      // 负责人电话
            constructAccordingDrawings: '',     // 是否按图纸施工
            segmentedCompressionQualified: '',  // 分段打压是否合格
            backfillTime: '',                   // 回填时间
            constructTime: '',                  // 施工时间
            zEngiineeringPhotoBoList: [],              // 图片列表
            zEngineeringMaterialBo: [],         // 用料对象
          }
        })
        this.tabsModel = nodeOptions[0].name
        console.log('当前工程所有节点', this.nodeList)
      }

      // end
      this.currentType = type
      console.log(this.queryParams)
      console.log(this.currentType)
      getEnginMaterialQualityList(this.currentType).then(res => {
        console.log(res)
      })
      this.params = queryParams
      console.log('111', this.params)
      this.nodeDetailVisible = true
      // if(type == 15){
      //   this.zEngineeringInfoBo = this.params.zEngineeringNodeBo.zEngineeringInfoBo
      // }
      // if(type == 16){
      //   this.zEngineeringInfoBo = this.params.zEngineeringNodeBo.zEngineeringInfoBo
      // }
      if (type == 14) {
        this.zEngineeringInfoBo = this.params.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
      }
      if (type === 37) {
        this.zEngineeringInfoBo = this.params.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
        this.nodeType = this.params.zEngineeringNodeBoList[0].type
      }
    },
    reset() {
      this.$refs['nodeForm'].resetFields()
      this.resetForm("nodeForm");
    }
  }
}
</script>

<style lang="scss" scoped>

::v-deep .engineNodeTypes {
  position: relative;
  top: -4%;
  left: -1.5%;
  width: 103%;
  box-shadow: none;

  .el-tabs__content {
    display: none;
  }
}

.el-checkbox {
  width: 200px;
}

::v-deep .el-dialog:not(.is-fullscreen) {
  margin-top: 4vh !important;
}

::v-deep .appendElNodeDialog {
  // width: 70%;
  height: 93%;

  .el-checkbox-group {
    padding-left: 5%;
  }

  .el-dialog__body {
    height: 85%;
  }

  .el-form-item {
    margin-bottom: 22px;
    width: 44%;
    display: inline-block;
  }

  .el-form-item:nth-child(2n+2) {
    margin-left: 5%;
  }

  .el-form-item:not(:nth-child(1):nth-child(2)) {
    margin-top: 0.5%;
  }
}
</style>

