<template>
    <el-container :style="'padding:10px;height:' + vh" id="dept">
        <el-aside :width="'240px'" id="drag-dept-left" :style="'background:#f8fbfdf3;height:' + vh">
            <div class="dept-left-input">
                <el-input v-model="filterText" clearable placeholder="请输入关键词" prefix-icon="el-icon-search"
                    size="small" />
            </div>
            <div class="dept-left-tree overview_scroll">
                <el-tree ref="tree" :data="treeMenus" id="menuTree" :props="{ children: 'children', label: 'name' }"
                    node-key="id" highlight-curren :show-checkbox="false" :expand-on-click-node="true"
                    :default-expanded-keys="[...expanded, treeId, pid]" :default-checked-keys="[currentNode]"
                    :current-node-key="currentNode" accordion :highlight-current="true" :filter-node-method="filterNode"
                    @node-click="handleNodeClick" :style="'height:' + vhh + 'px ;'">
                    <!--   default-expand-all -->
                    <span class="span-ellipsis" slot-scope="{ node, data }">
                        <i :class="data.icon"></i>
                        <span style="font-size: 16px" class="title" :title="node.label">{{ node.label }}</span>
                    </span>
                </el-tree>
            </div>
        </el-aside>
        <!--分隔条-->
        <div id="drag-dept" :style="'width:10px;height:' + vh">
            <i></i>
            <i></i>
        </div>
        <el-main id="drag-dept-right" :style="'background:#fcfcfcf3;height:' + vmh">
            <!--改变页面状态的按钮-->

            <el-form :inline="true" class="demo-form-inline">
                <el-form-item>
                    <el-button size="mini" class="el-icon-plus" type="primary" @click="add">新 增</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini" class="el-icon-edit" type="primary" @click="update">修 改</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini" class="el-icon-close" type="danger" @click="remove">删 除</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini" class="el-icon-right" :disabled="nextfalg" type="primary" @click="next"
                        v-if="nodeLevel <= 700 && pageStatus == 2">
                        下一步
                    </el-button>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini" type="info" @click="black" class="el-icon-back"
                        v-if="nodeLevel <= 700 && (pageStatus == 2 || pageStatus == 3)">
                        撤 销
                    </el-button>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini" text-align="center" class="el-icon-check" type="primary"
                        v-if="pageStatus == 2" @click="onsubmit">
                        确认提交
                    </el-button>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini" text-align="center" class="el-icon-check" type="primary"
                        v-if="pageStatus == 3" @click="onsubmit">
                        修改提交
                    </el-button>
                </el-form-item>
                <el-form-item style="right: 0; position: absolute">
                    <i style="margin-top: 6px; font-size: 20px; color: #396" class="el-icon-location-information"></i>
                    <span style="margin-top: 0.4%; font-size: 16px; font-weight: bold; color: #396">
                        当前操作节点：
                    </span>
                    <div style="float: right; margin-top: 10px">
                        <el-breadcrumb separator-class="el-icon-arrow-right" style="font-weight: bold; cursor: pointer">
                            <el-breadcrumb-item>台账管理</el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 100" @click.native="topath('#id100', 0)">
                                <a :style="changeSelectStyle == 0
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title100 }}
                                </a>
                            </el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 200" @click.native="topath('#id200', 1)">
                                <a :style="changeSelectStyle == 1
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title200 }}
                                </a>
                            </el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 300" @click.native="topath('#id300', 2)">
                                <a :style="changeSelectStyle == 2
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title300 }}
                                </a>
                            </el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 400" @click.native="topath('#id400', 3)">
                                <a :style="changeSelectStyle == 3
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title400 }}
                                </a>
                            </el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 500" @click.native="topath('#id500', 4)">
                                <a :style="changeSelectStyle == 4
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title500 }}
                                </a>
                            </el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 600" @click.native="topath('#id600', 5)">
                                <a :style="changeSelectStyle == 5
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title600 }}
                                </a>
                            </el-breadcrumb-item>
                            <el-breadcrumb-item v-if="level >= 700" @click.native="topath('#id700', 6)">
                                <a :style="changeSelectStyle == 6
                                        ? 'color:rgb(8, 213, 240);cursor: pointer;font-weight: bold;'
                                        : ''
                                    ">
                                    {{ title700 }}
                                </a>
                            </el-breadcrumb-item>
                        </el-breadcrumb>
                    </div>
                </el-form-item>
            </el-form>

            <!-- <div class="main-btn">
      </div> -->
            <!--页面查看 回显 编辑 删除-->

            <el-form class="main-form overview_scroll" :label-position="'right'" :model="AddProjectBO"
                label-width="120px" ref="mainForm" :style="'margin-top:10px;height:' + vth + '; overflow-y: scroll;'">
                <div class="form-top flex">
                    <el-form-item id="id100" class="form-item" v-if="
                        AddProjectBO.projectParam &&
                        ((pageStatus != 3 && nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 2)) ||
                            (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                    " label="项目名称:" :prop="'projectParam.name'"
                        :rules="{ required: true, message: '请输入项目名称', trigger: 'blur' }">
                        <el-select v-model="AddProjectBO.projectParam.name" placeholder="请选择项目类型" :disabled="nodeLevel > 100 && (pageStatus == 3 || pageStatus == 2)
                                ? pageStatus == 3 || pageStatus == 2
                                : pageStatus == 1
                            ">
                            <el-option v-for="item in project" :key="item.name" :label="item.name"
                                :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item id="id100" class="form-item" v-if="
                        AddProjectBO.projectParam &&
                        ((pageStatus != 3 && nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 2)) ||
                            (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                    " label="项目排序:" :prop="'projectParam.sort'"
                        :rules="{ required: true, message: '请输入排序', trigger: 'blur' }">
                        <el-input v-model="AddProjectBO.projectParam.sort" placeholder="请输入排序" :disabled="nodeLevel > 100 && (pageStatus == 3 || pageStatus == 2)
                                ? pageStatus == 3 || pageStatus == 2
                                : pageStatus == 1
                            "></el-input>
                    </el-form-item>
                    <el-form-item id="id200" class="form-item" v-if="
                        AddProjectBO.provinceParam &&
                        ((pageStatus != 3 && nodeLevel > 100 && (nodeLevel <= 700 || pageStatus == 2)) ||
                            (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                    " label="行政区域:" :prop="'provinceParam.name'"
                        :rules="[{ required: true, message: '请选择行政区域', trigger: 'change' }]">
                        <el-select v-model="areaName" placeholder="请选择行政区域" style="width: 100%" :disabled="nodeLevel > 200 && (pageStatus == 3 || pageStatus == 2)
                                ? pageStatus == 3 || pageStatus == 2
                                : pageStatus == 1
                            ">
                            <el-option :value="provinceIndex" style="height: auto">
                                <el-tree :data="treeOptions" node-key="id" accordion :default-expanded-keys="idArr2"
                                    :props="defaultProps4" @node-click="handNodeClicktree"
                                    style="width: 250px; height: 15vh; overflow: auto">
                                    <span class="span-ellipsis" slot-scope="{ node, data }">
                                        <span :title="data.name">{{ data.name }}</span>
                                    </span>
                                </el-tree>
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item id="id200" class="form-item" v-if="
                        AddProjectBO.provinceParam &&
                        ((pageStatus != 3 && nodeLevel > 100 && (nodeLevel <= 700 || pageStatus == 2)) ||
                            (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                    " label="区域排序:" :prop="'provinceParam.sort'"
                        :rules="[{ required: true, message: '请输入排序', trigger: 'change' }]">
                        <el-input v-model="AddProjectBO.provinceParam.sort" :disabled="nodeLevel > 200 && (pageStatus == 3 || pageStatus == 2)
                                ? pageStatus == 3 || pageStatus == 2
                                : pageStatus == 1
                            "></el-input>
                    </el-form-item>
                    <!--供电公司 ((pageStatus != 3 && (nodeLevel > 200 && (nodeLevel &lt; 700 || pageStatus == 2))) || (pageStatus == 3 && nodeLevel == 300))-->
                    <el-form-item id="id300" class="form-item" v-if="
                        AddProjectBO.gdInformationParam &&
                        ((pageStatus != 3 && nodeLevel > 200 && (nodeLevel <= 700 || pageStatus == 2)) ||
                            (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                    " label="供电公司:" :prop="'gdInformationParam.name'"
                        :rules="[{ required: true, message: '请输入供电公司', trigger: 'blur' }]">
                        <el-input v-model="AddProjectBO.gdInformationParam.name" :disabled="nodeLevel > 300 && (pageStatus == 3 || pageStatus == 2)
                                ? pageStatus == 3 || pageStatus == 2
                                : pageStatus == 1
                            "></el-input>
                    </el-form-item>
                    <el-form-item id="id300" class="form-item" v-if="
                        AddProjectBO.gdInformationParam &&
                        ((pageStatus != 3 && nodeLevel > 200 && (nodeLevel <= 700 || pageStatus == 2)) ||
                            (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                    " label="公司排序:" :prop="'gdInformationParam.sort'"
                        :rules="[{ required: true, message: '请输入排序', trigger: 'blur' }]">
                        <el-input v-model="AddProjectBO.gdInformationParam.sort" :disabled="nodeLevel > 300 && (pageStatus == 3 || pageStatus == 2)
                                ? pageStatus == 3 || pageStatus == 2
                                : pageStatus == 1
                            "></el-input>
                    </el-form-item>
                </div>
                <!--变电站((pageStatus != 3 &&(nodeLevel > 300 && (nodeLevel &lt; 700 || pageStatus == 2))) || (pageStatus == 3 && nodeLevel == 400))-->
                <div id="id400" class="form-zhan" v-if="
                    AddProjectBO.subStationParam &&
                    ((pageStatus != 3 && nodeLevel > 300 && (nodeLevel <= 700 || pageStatus == 2)) ||
                        (nodeLevel > 0 && (nodeLevel <= 700 || pageStatus == 3)))
                ">
                    <!-- <div class="form-tag">
            <el-tag type="warning" style="width:100%;border-color: #abbec26c;">变电站:</el-tag>
          </div> -->
                    <div class="flex">
                        <el-form-item class="form-item" label="变电站:" :prop="'subStationParam.name'"
                            :rules="{ required: true, message: '请输入变电站名称', trigger: 'blur' }">
                            <el-input v-model="AddProjectBO.subStationParam.name" :disabled="nodeLevel > 400 && (pageStatus == 3 || pageStatus == 2)
                                    ? pageStatus == 3 || pageStatus == 2
                                    : pageStatus == 1
                                "></el-input>
                        </el-form-item>

                        <el-form-item class="form-item" label="经度:" :prop="'subStationParam.lng'"
                            :rules="[{ required: true, validator: lngff, trigger: 'blur' }]">
                            <el-input v-model="AddProjectBO.subStationParam.lng" :disabled="nodeLevel > 400 && (pageStatus == 3 || pageStatus == 2)
                                    ? pageStatus == 3 || pageStatus == 2
                                    : pageStatus == 1
                                "></el-input>
                        </el-form-item>

                        <el-form-item class="form-item" label="纬度:" :prop="'subStationParam.lat'"
                            :rules="[{ required: true, validator: latff, trigger: 'blur' }]">
                            <el-input v-model="AddProjectBO.subStationParam.lat" :disabled="nodeLevel > 400 && (pageStatus == 3 || pageStatus == 2)
                                    ? pageStatus == 3 || pageStatus == 2
                                    : pageStatus == 1
                                "></el-input>
                        </el-form-item>

                        <el-form-item class="form-item" label="电压等级:" :prop="'subStationParam.scale'"
                            :rules="[{ required: true, message: '选中电压等级', trigger: 'change' }]">
                            <el-select v-model="AddProjectBO.subStationParam.scale" placeholder="请选择电压等级" :disabled="nodeLevel > 400 && (pageStatus == 3 || pageStatus == 2)
                                    ? pageStatus == 3 || pageStatus == 2
                                    : pageStatus == 1
                                ">
                                <el-option v-for="item in voltageLevelArr" :key="item.name" :label="item.name"
                                    :value="item.id"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item class="form-item" label="排序:" :prop="'subStationParam.sort'"
                            :rules="[{ required: true, message: '输入排序', trigger: 'change' }]">
                            <el-input v-model="AddProjectBO.subStationParam.sort" placeholder="请输入排序" :disabled="nodeLevel > 400 && (pageStatus == 3 || pageStatus == 2)
                                    ? pageStatus == 3 || pageStatus == 2
                                    : pageStatus == 1
                                "></el-input>
                        </el-form-item>
                    </div>
                </div>
                <!--终端设备-->
                <div id="id500" class="form-device" v-if="
                    (pageStatus != 3 && nodeLevel > 300 && (nodeLevel <= 700 || pageStatus == 2)) ||
                    (pageStatus == 3 && 400 < nodeLevel && nodeLevel <= 700)
                ">
                    <!--<div class="form-tag">
            <el-tag style="width:100%;border-color: #04738a6c;">终端设备:</el-tag>
          </div> -->
                    <el-tabs v-if="AddProjectBO.deviceParam && AddProjectBO.deviceParam.length" v-model="deviceIndex"
                        type="card" :editable="pageStatus != 1" @edit="handleDeviceTabsEdit"
                        @tab-click="tabChange('deviceIndex')">
                        <el-tab-pane v-for="(item, index) in AddProjectBO.deviceParam" :key="index"
                            :label="item.name ? item.name : '新建终端' + index" :name="index + ''">
                            <div class="flex">
                                <el-form-item class="form-item" label="名称:" :prop="'deviceParam.' + index + '.name'"
                                    :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]">
                                    <el-input v-model="item.name" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        " placeholder="请输入名称"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="通讯状态:"
                                    :prop="'deviceParam.' + index + '.comFlag'"
                                    :rules="[{ required: true, message: '请选择通讯状态', trigger: 'change' }]">
                                    <el-select v-model="item.comFlag" placeholder="请选择通讯状态" :disabled="true">
                                        <el-option v-for="option in comStatusArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="通讯类型:"
                                    :prop="'deviceParam.' + index + '.frontType'"
                                    :rules="[{ required: true, message: '请选择通讯类型', trigger: 'change' }]">
                                    <el-select v-model="item.frontType" placeholder="请选择通讯类型"
                                        :popper-append-to-body="false" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                                ? pageStatus == 3 || pageStatus == 2
                                                : pageStatus == 1
                                            ">
                                        <el-option v-for="option in comTypeStatusArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="终端模型:"
                                    :prop="'deviceParam.' + index + '.devModel'"
                                    :rules="[{ required: true, message: '请选择终端模型', trigger: 'change' }]">
                                    <el-select v-model="item.devModel" placeholder="请选择终端模型" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in terminalModelArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="数据模型:"
                                    :prop="'deviceParam.' + index + '.devDataType'"
                                    :rules="[{ required: true, message: '请选择数据模型', trigger: 'change' }]">
                                    <el-select v-model="item.devDataType" placeholder="请选择数据模型" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in dataModelArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="厂家:"
                                    :prop="'deviceParam.' + index + '.manufacturer'"
                                    :rules="[{ required: true, message: '请选择厂家', trigger: 'change' }]">
                                    <el-select v-model="item.manufacturer" placeholder="请选择厂家"
                                        :popper-append-to-body="false" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                                ? pageStatus == 3 || pageStatus == 2
                                                : pageStatus == 1
                                            ">
                                        <el-option v-for="option in factoryArr" :key="option.id" :label="option.name"
                                            :value="option.id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="所属前置机:"
                                    :prop="'deviceParam.' + index + '.nodeId'"
                                    :rules="[{ required: true, message: '请选择所属前置机', trigger: 'change' }]">
                                    <el-select v-model="item.nodeId" placeholder="请选择所属前置机" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in affiliatiedFrontArr" :key="option.id"
                                            :label="option.name" :value="option.id"></el-option>
                                    </el-select>
                                    <!-- <el-button type="primary" icon="el-icon-share" circle size="mini" style="position:absolute;margin-top:3px"></el-button> -->
                                </el-form-item>
                                <el-form-item class="form-item" label="召唤标志:"
                                    :prop="'deviceParam.' + index + '.callFlag'"
                                    :rules="[{ required: true, message: '请选择召唤标志', trigger: 'change' }]">
                                    <el-select v-model="item.callFlag" placeholder="请选择召唤标志" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in summonSignArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="识别码:" :prop="'deviceParam.' + index + '.series'">
                                    <el-input v-model="item.series" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        " show-password placeholder="请输入识别码"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="密钥:" :prop="'deviceParam.' + index + '.devKey'">
                                    <el-input v-model="item.devKey" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        " show-password placeholder="请输入密钥"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="电度功能"
                                    :prop="'deviceParam.' + index + '.electroplate'"
                                    :rules="[{ required: true, message: '请选择电度功能', trigger: 'change' }]">
                                    <el-select v-model="item.electroplate" placeholder="请选择电度功能" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in electroplateCanArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="投运时间:">
                                    <el-date-picker :popper-append-to-body="false" type="date" placeholder="选择日期"
                                        format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="item.loginTime"
                                        :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                                ? pageStatus == 3 || pageStatus == 2
                                                : pageStatus == 1
                                            "></el-date-picker>
                                </el-form-item>
                                <el-form-item class="form-item" label="本次定检时间:">
                                    <el-date-picker :popper-append-to-body="false" type="date" placeholder="选择日期"
                                        format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="item.thisTimeCheck"
                                        :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                                ? pageStatus == 3 || pageStatus == 2
                                                : pageStatus == 1
                                            "></el-date-picker>
                                </el-form-item>
                                <el-form-item class="form-item" label="下次定检时间:">
                                    <el-date-picker :popper-append-to-body="false" type="date" placeholder="选择日期"
                                        format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="item.nextTimeCheck"
                                        :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                                ? pageStatus == 3 || pageStatus == 2
                                                : pageStatus == 1
                                            "></el-date-picker>
                                </el-form-item>
                                <el-form-item class="form-item" label="数据更新时间:">
                                    <!-- <el-date-picker
                  type="date"
                  placeholder="选择日期"
                  format=yyyy-MM-dd
                  value-format=yyyy-MM-dd
                  v-model="item.updateTime"
                  :disabled="nodeLevel>500 &&(pageStatus == 3 || pageStatus == 2 )?pageStatus == 3 || pageStatus == 2:pageStatus == 1"></el-date-picker> -->
                                    <el-date-picker type="date" placeholder="选择日期" format="yyyy-MM-dd"
                                        value-format="yyyy-MM-dd" v-model="item.updateTime"
                                        :disabled="true"></el-date-picker>
                                </el-form-item>
                                <el-form-item class="form-item" label="设备型号:"
                                    :prop="'deviceParam.' + index + '.devType'"
                                    :rules="[{ required: true, message: '请选择设备型号', trigger: 'change' }]">
                                    <el-select v-model="item.devType" placeholder="请选择设备型号" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in typeArr" :key="option.devType" :label="option.name"
                                            :value="option.id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="IP/MAC地址:" :prop="'deviceParam.' + index + '.ip'"
                                    :rules="[{ required: true, validator: arrdess, trigger: 'blur' }]">
                                    <el-input v-model="item.ip" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        " placeholder="请输入IP/MAC地址"></el-input>
                                </el-form-item>
                                <!-- <el-form-item class="form-item" label="供电公司:" :prop="'deviceBO.' + index + '.gdName'"
                    :rules="[{required: true, message: '请输入供电公司', trigger: 'blur',},]"
                >
                  <el-input v-model="item.gdName" :disabled="pageStatus == 1" placeholder="请输入供电公司" ></el-input>
                </el-form-item> -->
                                <!-- <el-form-item class="form-item" label="所属变电站:">
                  <el-input v-model="item.zhan" :disabled="pageStatus == 1" placeholder="请输入所属变电站" ></el-input>
                </el-form-item> -->
                                <el-form-item class="form-item" label="端口号:" :prop="'deviceParam.' + index + '.port'"
                                    :rules="[{ required: true, message: '请输入端口号', trigger: 'blur' }]">
                                    <el-input v-model="item.port" placeholder="请输入端口号" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        "></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="合同号:"
                                    :prop="'deviceParam.' + index + '.contract'"
                                    :rules="[{ required: true, message: '请输入合同号', trigger: 'blur' }]">
                                    <el-input v-model="item.contract" placeholder="请输入合同号" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        "></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="ISM卡号:" :prop="'deviceParam.' + index + '.sim'"
                                    :rules="[{ required: true, message: '请输入ISM卡号', trigger: 'blur' }]">
                                    <el-input v-model="item.sim" placeholder="请输入ISM卡号" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        "></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="排序:" :prop="'deviceParam.' + index + '.sort'"
                                    :rules="[{ required: true, message: '请输入排序', trigger: 'blur' }]">
                                    <el-input v-model="item.sort" placeholder="请输入排序" :disabled="nodeLevel > 500 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        "></el-input>
                                </el-form-item>
                            </div>
                        </el-tab-pane>
                    </el-tabs>
                </div>
                <!--母线-->
                <div id="id600" class="form-bus"
                    v-if="((pageStatus != 3 && (nodeLevel > 400 && (nodeLevel &lt;= 700 || pageStatus == 2))) |  (pageStatus == 3 && 400 < nodeLevel && nodeLevel &lt;= 700))">
                    <!-- <div class="form-tag">
           <el-tag type="danger" style="width:100%; background-color:#996a7048;border-color: #7e3a3a5e;">母线:</el-tag>
          </div> -->
                    <el-tabs v-if="
                        AddProjectBO.deviceParam &&
                        AddProjectBO.deviceParam.length &&
                        AddProjectBO.deviceParam[deviceIndex] &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam.length
                    " v-model="busBarIndex" type="card" :editable="pageStatus != 1" @edit="handleBusBarTabsEdit"
                        @tab-click="tabChange('busBarIndex')">
                        <el-tab-pane v-for="(busItem, bIndex) in AddProjectBO.deviceParam[deviceIndex].subVoltageParam"
                            :key="bIndex" :label="busItem.name ? busItem.name : '新建母线' + bIndex" :name="bIndex + ''">
                            <div class="flex">
                                <el-form-item class="form-item" label="母线名称:"
                                    :prop="'deviceParam.' + [deviceIndex] + '.subVoltageParam.' + bIndex + '.name'"
                                    :rules="{ required: true, message: '请输入母线名称', trigger: 'blur' }">
                                    <el-input v-model="busItem.name" placeholder="请输入母线名称" :disabled="nodeLevel > 600 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        "></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="母线编号:"
                                    :prop="'deviceParam.' + [deviceIndex] + '.subVoltageParam.' + bIndex + '.num'"
                                    :rules="{ required: true, message: '请输入母线编号', trigger: 'blur' }">
                                    <el-select v-model="busItem.num" placeholder="请选择母线编号" :disabled="nodeLevel > 600 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in optionarr" :key="option.name" :label="option.name"
                                            :value="option.value"></el-option>
                                    </el-select>
                                    <!-- <el-input v-model="busItem.subvNum" placeholder="请输入母线编号" :disabled="pageStatus == 1"></el-input> :value="{label:option.dicName,value:option.dicIndex}" -->
                                </el-form-item>
                                <el-form-item class="form-item" label="电压等级:"
                                    :prop="'deviceParam.' + [deviceIndex] + '.subVoltageParam.' + bIndex + '.scale'"
                                    :rules="{ required: true, message: '请选择电压等级', trigger: 'blur' }">
                                    <el-select v-model="busItem.scale" value-key="value" placeholder="请选择电压等级"
                                        :disabled="nodeLevel > 600 && (pageStatus == 3 || pageStatus == 2)
                                                ? pageStatus == 3 || pageStatus == 2
                                                : pageStatus == 1
                                            " @change="selectChanged">
                                        <el-option v-for="option in voltageLevelArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="母线类型:"
                                    :prop="'deviceParam.' + [deviceIndex] + '.subVoltageParam.' + bIndex + '.model'"
                                    :rules="{ required: true, message: '请选择母线类型', trigger: 'blur' }">
                                    <el-select v-model="busItem.model" placeholder="请选择母线类型" :disabled="nodeLevel > 600 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        ">
                                        <el-option v-for="option in busBarType" :key="option.name" :label="option.name"
                                            :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="排序:"
                                    :prop="'deviceParam.' + [deviceIndex] + '.subVoltageParam.' + bIndex + '.sort'"
                                    :rules="{ required: true, message: '请输入排序', trigger: 'blur' }">
                                    <el-input v-model="busItem.sort" placeholder="请输入排序" :disabled="nodeLevel > 600 && (pageStatus == 3 || pageStatus == 2)
                                            ? pageStatus == 3 || pageStatus == 2
                                            : pageStatus == 1
                                        "></el-input>
                                </el-form-item>
                            </div>
                        </el-tab-pane>
                    </el-tabs>
                </div>
                <!--监测点-->
                <div id="id700" class="form-point"
                    v-if="((pageStatus != 3 && (nodeLevel > 400 && (nodeLevel &lt;= 700 || pageStatus == 2))) || (pageStatus == 3 && 400 < nodeLevel && nodeLevel &lt;= 700))">
                    <!-- <div class="form-tag">
           <el-tag type="success" style="width:100%;background-color: #83b49b93;border-color: #62b1a65e;">监测点:</el-tag>
          </div> -->
                    <el-tabs type="card" v-if="
                        AddProjectBO.deviceParam &&
                        AddProjectBO.deviceParam.length &&
                        AddProjectBO.deviceParam[deviceIndex] &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam.length &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam[busBarIndex] &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam[busBarIndex].lineParam &&
                        AddProjectBO.deviceParam[deviceIndex].subVoltageParam[busBarIndex].lineParam.length
                    " v-model="lineIndex" :editable="pageStatus != 1" @edit="handleLineTabsEdit"
                        @tab-click="tabChange('lineIndex')">
                        <el-tab-pane v-for="(lineItem, lIndex) in AddProjectBO.deviceParam[deviceIndex].subVoltageParam[
                            busBarIndex
                        ].lineParam" :key="lIndex" :label="lineItem.name ? lineItem.name : '新建监测点' + lIndex"
                            :name="lIndex + ''">
                            <div class="flex">
                                <el-form-item class="form-item" label="监测点名称:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.name'
                                    " :rules="{ required: true, message: '请输入监测点名称', trigger: 'blur' }">
                                    <el-input v-model="lineItem.name" :disabled="pageStatus == 1"
                                        placeholder="请输入监测点名称"></el-input>
                                </el-form-item>
                                <!-- <el-form-item class="form-item" label="所属部门:"
                 :prop="'deviceBO.'+[deviceIndex]+'.subVoltage.' + [busBarIndex] + '.line.'+lIndex+'.deptIndex'"
                :rules="{ required: true,message: '请选择部门', trigger: 'blur',}">
                  <el-select v-model="lineItem.deptIndex" placeholder="请选择部门" :disabled="pageStatus == 1">
                    <el-option v-for="option in departmentArr"
                        :key="option.dicIndex"
                        :label="option.deptsName"
                        :value="option.deptsIndex"
                    ></el-option>
                  </el-select>
                </el-form-item> -->
                                <el-form-item class="form-item" label="监测点序号:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.num'
                                    " :rules="{ required: true, message: '请选择监测点序号', trigger: 'blur' }">
                                    <el-select v-model="lineItem.num" placeholder="请选择序号" :disabled="pageStatus == 1">
                                        <el-option v-for="option in pointNumArr" :key="option.name" :label="option.name"
                                            :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <!-- <el-form-item class="form-item" label="电压等级:"
                 :prop="'deviceBO.'+[deviceIndex]+'.subVoltage.' + [busBarIndex] + '.line.'+lIndex+'.scale'"
                :rules="{ required: true,message: '请选择电压等级', trigger: 'blur',}">
                  <el-select v-model="monitorPointDetail.scale" placeholder="请选择电压等级" :disabled="pageStatus == 1"  @change="selectChanged">
                    <el-option v-for="option in voltageLevelArr"
                        :key="option.dicIndex"
                        :label="option.dicName"
                        :value="{value:option.dicIndex,label:option.dicName}"
                    ></el-option>
                  </el-select>
                </el-form-item> -->
                                <!-- :prop="'deviceBO.'+[deviceIndex]+'.subVoltage.' + [busBarIndex] + '.line.'+lIndex+'.jzCmp'"
                :rules="{ required: true,message: '请输入基准量', trigger: 'blur',}" -->
                                <el-form-item class="form-item" label="基准容量(MVA):">
                                    <!-- <el-input v-if="pageStatus == 2" v-model="monitorPointDetail.standardCapacity" :disabled="pageStatus == 1" placeholder="请输入基准容量(MVA)" ></el-input> -->
                                    <el-input v-model="lineItem.standardCapacity" :disabled="pageStatus == 1"
                                        placeholder="请输入基准容量(MVA)"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="短路容量(MVA):" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.shortCapacity'
                                    " :rules="{ required: false, message: '请输入短路容量', trigger: 'blur' }">
                                    <!-- <el-form-item class="form-item" label="短路容量(MVA):" >  -->
                                    <!-- <el-input v-if="pageStatus == 2" v-model="monitorPointDetail.shortCapacity" :disabled="pageStatus == 1" placeholder="请输入短路容量(MVA)"></el-input> -->
                                    <el-input v-model="lineItem.shortCapacity" :disabled="pageStatus == 1"
                                        placeholder="请输入短路容量(MVA)"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="设备容量(MVA):" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.devCapacity'
                                    " :rules="{ required: false, message: '请输入设备容量', trigger: 'blur' }">
                                    <!-- <el-form-item class="form-item" label="设备容量(MVA):" >  -->
                                    <el-input v-model="lineItem.devCapacity" :disabled="pageStatus == 1"
                                        placeholder="请输入设备容量(MVA)"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="协议容量(MVA):" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.dealCapacity'
                                    " :rules="{ required: false, message: '请输入协议容量', trigger: 'blur' }">
                                    <!-- <el-form-item class="form-item" label="协议容量(MVA):" >   -->
                                    <el-input v-model="lineItem.dealCapacity" :disabled="pageStatus == 1"
                                        placeholder="请输入协议容量(MVA)"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="测量点间隔:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.timeInterval'
                                    " :rules="{ required: true, message: '请选择测点间隔', trigger: 'blur' }">
                                    <el-select v-model="lineItem.timeInterval" placeholder="请选择测量点间隔"
                                        :disabled="pageStatus == 1">
                                        <el-option v-for="option in lineSpaceArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="PT变比:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.pt1'
                                    " :rules="{ required: true, message: '请输入pt', trigger: 'blur' }">
                                    <div class="flex" style="justify-content: space-between">
                                        <el-input style="width: 48%" v-model="lineItem.pt1"
                                            :disabled="pageStatus == 1"></el-input>
                                        <el-input style="width: 48%" v-model="lineItem.pt2"
                                            :disabled="pageStatus == 1"></el-input>
                                    </div>
                                </el-form-item>
                                <el-form-item class="form-item" label="CT变比:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.ct1'
                                    " :rules="{ required: true, message: '请输入ct', trigger: 'blur' }">
                                    <div class="flex" style="justify-content: space-between">
                                        <el-input style="width: 48%" v-model="lineItem.ct1"
                                            :disabled="pageStatus == 1"></el-input>
                                        <el-input style="width: 48%" v-model="lineItem.ct2"
                                            :disabled="pageStatus == 1"></el-input>
                                    </div>
                                </el-form-item>
                                <el-form-item class="form-item" label="接线类型:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.ptType'
                                    " :rules="{ required: true, message: '请选择接线类型', trigger: 'blur' }">
                                    <el-select v-model="lineItem.ptType" placeholder="请选择接线类型"
                                        :disabled="pageStatus == 1">
                                        <el-option v-for="option in wiringTypeArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="干扰源类型:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.loadType'
                                    " :rules="{ required: true, message: '请选择干扰源类型', trigger: 'blur' }">
                                    <el-select v-model="lineItem.loadType" placeholder="请选择干扰源类型"
                                        :disabled="pageStatus == 1">
                                        <el-option v-for="option in loadTypeArr" :key="option.id" :label="option.name"
                                            :value="option.id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="行业类型:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.businessType'
                                    " :rules="{ required: true, message: '请选择行业类型', trigger: 'blur' }">
                                    <el-select v-model="lineItem.businessType" placeholder="请选择行业类型"
                                        :disabled="pageStatus == 1">
                                        <el-option v-for="option in industryTypeArr" :key="option.id"
                                            :label="option.name" :value="option.id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="谐波监测号:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.monitorId'
                                    ">
                                    <el-input v-model="lineItem.monitorId" :disabled="pageStatus == 1"
                                        placeholder="请输入网公司谐波监测号"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="电压下偏差:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.uvoltageDev'
                                    " :rules="{ required: true, message: '请输入电压下偏差', trigger: 'blur' }">
                                    <el-input v-model="lineItem.uvoltageDev" :disabled="pageStatus == 1"
                                        placeholder="请输入电压下偏差"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="对象名称:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.objName'
                                    ">
                                    <el-input v-model="lineItem.objName" :disabled="pageStatus == 1"
                                        placeholder="请输入对象名称"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="测量点性质:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.powerFlag'
                                    " :rules="{ required: true, message: '请选择测量点性质', trigger: 'blur' }">
                                    <el-select v-model="lineItem.powerFlag" placeholder="请选择测量点性质"
                                        :disabled="pageStatus == 1">
                                        <el-option v-for="option in lineNatureArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="电压上偏差:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.voltageDev'
                                    " :rules="{ required: true, message: '请输入电压上偏差', trigger: 'blur' }">
                                    <el-input v-model="lineItem.voltageDev" :disabled="pageStatus == 1"
                                        placeholder="请输入电压上偏差"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="备注:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.remark'
                                    ">
                                    <el-input v-model="lineItem.remark" :disabled="pageStatus == 1"
                                        placeholder="请输入备注"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="分类等级:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.calssificationGrade'
                                    " :rules="{ required: true, message: '请选择分类等级', trigger: 'blur' }">
                                    <el-select v-model="lineItem.calssificationGrade" placeholder="请选择分类等级"
                                        :disabled="pageStatus == 1">
                                        <el-option v-for="option in pointTypeArr" :key="option.name"
                                            :label="option.name" :value="option.value"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item class="form-item" label="监测点拥有者:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.owner'
                                    " :rules="{ required: true, message: '请输入监测点拥有者', trigger: 'blur' }">
                                    <el-input v-model="lineItem.owner" :disabled="pageStatus == 1"
                                        placeholder="请输入监测点拥有者"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="拥有者职务:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.ownerDuty'
                                    " :rules="{ required: true, message: '请输入拥有者职务', trigger: 'blur' }">
                                    <el-input v-model="lineItem.ownerDuty" :disabled="pageStatus == 1"
                                        placeholder="请输入拥有者职务"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="电网侧变电站:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.powerSubstationName'
                                    " :rules="{ required: true, message: '请输入电网侧变电站', trigger: 'blur' }">
                                    <el-input v-model="lineItem.powerSubstationName" :disabled="pageStatus == 1"
                                        placeholder="请输入电网侧变电站"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="上级变电站:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.superiorsSubstation'
                                    " :rules="{ required: true, message: '请输入上级变电站', trigger: 'blur' }">
                                    <el-input v-model="lineItem.superiorsSubstation" :disabled="pageStatus == 1"
                                        placeholder="请输入上级变电站"></el-input>
                                </el-form-item>
                                <el-form-item class="form-item" label="排序:" :prop="'deviceParam.' +
                                    [deviceIndex] +
                                    '.subVoltageParam.' +
                                    [busBarIndex] +
                                    '.lineParam.' +
                                    lIndex +
                                    '.sort'
                                    " :rules="{ required: true, message: '请输入排序', trigger: 'blur' }">
                                    <el-input v-model="lineItem.sort" :disabled="pageStatus == 1"
                                        placeholder="请输入排序"></el-input>
                                </el-form-item>
                            </div>
                        </el-tab-pane>
                    </el-tabs>
                </div>
            </el-form>
        </el-main>
    </el-container>
</template>
<script>
//import http from "@/request";
import { getappheight, viewheight } from '../../../assets/commjs/common'
import api from '@/api/Terminal/decive'
import { dicData } from '../../../assets/commjs/dictypeData'
export default {
    name: 'terminalmage',
    data() {
        return {
            expanded: [],
            filterText: '',
            ExpandedNum: 4,
            uuid: 0,
            vhh: undefined,
            nextfalg: false,
            expandID: [],
            aheight: undefined,
            vh: null,
            vmh: null,
            vth: null,
            height: undefined,
            height1: undefined,
            provinceIndex: '',
            treeOptions: [],
            defaultProps4: {
                children: 'children',
                label: 'name'
            },
            treeId: '',
            pid: '',
            idArr2: [],
            /**树结构 */
            treeMenus: [],
            /**树配置选项 */
            defaultProps: {
                children: 'children',
                label: 'name'
            },
            pointTypeArr: [
                { name: 'Ⅰ', value: 1 },
                { name: 'Ⅱ', value: 2 },
                { name: 'Ⅲ', value: 3 },
                { name: 'Ⅳ', value: 4 },
                { name: 'Ⅴ', value: 5 }
            ],
            optionarr: [
                { name: '1号母线', value: 1 },
                { name: '2号母线', value: 2 },
                { name: '3号母线', value: 3 },
                { name: '4号母线', value: 4 },
                { name: '5号母线', value: 5 },
                { name: '6号母线', value: 6 }
            ],
            /**搜索关键字 */
            keyword: '',
            /**项目名称 */
            project: [
                { name: '在线项目', value: '在线项目' },
                { name: '普测项目', value: '普测项目' }
            ],
            projectParam: { name: '', sort: 0 },
            /**城市列表 */
            city: [],
            /**行政区域 */
            provinceParam: { name: '全国', sort: 0 },
            /**供电公司 */
            gdInformationParam: { name: '', sort: 0 },
            /**变电站 */
            subStationParam: {
                /**名称 */
                name: '',
                /**经度 */
                lng: '0',
                /**纬度 */
                lat: '0',
                /**电压等级 */
                scale: '',
                /**排序 */
                sort: 0
            },
            /**设备数组 */
            deviceParam: [],
            /**设备详情 */
            deviceBODetail: {
                /**名称 */
                name: '',
                /**设备id*/
                devIndex: '',
                /**设备型号 */
                devType: '',
                /**ip */
                ip: '255.255.255.255',
                /**通讯状态 */
                comFlag: 0,
                /**通讯类型 */
                frontType: '',
                /**投运时间 */
                loginTime: '',
                /**数据更新时间 */
                updateTime: '',
                /**所属变电站 */
                zhan: '',
                /**所属前置机 */
                nodeId: '',
                /**终端模型 */
                devModel: 1,
                /**本次定检时间 */
                thisTimeCheck: '',
                /**下次定检时间 */
                nextTimeCheck: '',
                /**厂家 */
                manufacturer: '',
                /**数据模型 */
                devDataType: 2,
                /**端口号 */
                port: 102,
                /**排序 */
                sort: 0,
                //合同号
                contract: '',
                //ISM卡号
                sim: '',
                /**电镀功能 */
                electroplate: 0,
                /**识别码 */
                series: '',
                /**召唤标志 */
                callFlag: 0,
                /**密钥 */
                devKey: '',
                /**母线*/
                subVoltageParam: [],
                /**供电公司 */
                gdName: this.currentGdName
            },
            /**通讯状态选项 */
            comStatusArr: [
                { name: '中断', value: 0 },
                { name: '正常', value: 1 }
            ],
            /**通讯类型选项 */
            comTypeStatusArr: [],
            /**终端模型选项 */
            terminalModelArr: [
                { name: '实际终端', value: 1 },
                { name: '虚拟终端', value: 0 },
                { name: '离线终端', value: 2 }
            ],
            /**电镀功能选项 */
            electroplateCanArr: [
                { name: '开启', value: 0 },
                { name: '关闭', value: 1 }
            ],
            /**数据模型选项 */
            dataModelArr: [
                { name: '双系统', value: 2 },
                { name: '暂降系统', value: 0 },
                { name: '稳态系统', value: 1 }
            ],
            /**召唤标志选项 */
            summonSignArr: [
                { name: '变位触发', value: 0 },
                { name: '周期触发', value: 1 }
            ],
            /**厂家选项 */
            factoryArr: [],
            /**型号选项 */
            typeArr: [],
            /**所属前置机选项 */
            affiliatiedFrontArr: [],
            /**所属变电站选项 */
            affiliatedSubstationArr: [
                { name: '测试变电站1', value: '0' },
                { name: '测试变电站2', value: '1' },
                { name: '测试变电站3', value: '2' }
            ],
            /**母线详情 */
            busBarDetail: {
                /**母线名称 */
                name: '',
                /**母线编号 */
                num: 1,
                /**电压等级 */
                scale: '',
                /**母线类型 */
                model: 0,
                /**母线id */
                subvIndex: '',
                /**监测点 */
                lineParam: [],
                /**排序 */
                sort: 0
            },
            /**电压等级选项 */
            voltageLevelArr: [],
            /**母线类型 */
            busBarType: [
                { name: '实际母线', value: 0 },
                { name: '虚拟母线', value: 1 }
            ],
            /**监测点详情 */
            monitorPointDetail: {
                /**行业类型 */
                businessType: '',
                /**CT变比 */
                ct1: '',
                /**CT变比 */
                ct2: '',
                /**所属部门 */
                deptIndex: '',
                /**设备容量 */
                devCapacity: '',
                /**短路容量 */
                shortCapacity: '',
                /**基准容量 */
                standardCapacity: '',
                /**监测点id */
                lineIndex: '',
                /**监测点序号 */
                num: 1,
                //分类等级
                calssificationGrade: 1,
                //电网测变电站
                powerSubstationName: '',
                //监测点拥有着
                owner: '',
                //拥有者职位
                ownerDuty: '',
                //上级变电站
                superiorsSubstation: '',
                /**负荷类型 */
                loadType: '',
                /**网公司监测号 */
                monitorId: '',
                /**监测点名称 */
                name: '',
                /**对象名称 */
                objName: '',
                /**监测点性质 */
                powerFlag: 0,
                /**PT比 */
                pt1: 0,
                /**PT比 */
                pt2: 0,
                /**接线类型 */
                ptType: 0,
                /**测点间隔 */
                timeInterval: 1,
                /**协议容量 */
                dealCapacity: '',
                /**电压等级 */
                scale: '',
                /**备注 */
                remark: '',
                /**电压上偏差 */
                voltageDev: 10,
                /**电压下偏差 */
                uvoltageDev: 10,
                /**供电公司 */
                gdName: this.currentGdName,
                /**排序 */
                sort: 0
            },
            /**所属部门选项 */
            departmentArr: [],
            /**监测点序号 */
            pointNumArr: [
                { name: '1', value: 1 },
                { name: '2', value: 2 },
                { name: '3', value: 3 },
                { name: '4', value: 4 },
                { name: '5', value: 5 },
                { name: '6', value: 6 }
            ],
            /**接线类型选项 */
            wiringTypeArr: [
                { name: '星型接线', value: 0 },
                { name: '三角型接线', value: 1 },
                { name: '开口三角型接线', value: 2 }
            ],
            /**负荷类型选项 */
            loadTypeArr: [],
            /**行业类型选项 */
            industryTypeArr: [],
            /**监测点间隔 */
            lineSpaceArr: [
                { name: '1分钟', value: 1 },
                { name: '3分钟', value: 3 },
                { name: '5分钟', value: 5 },
                { name: '10分钟', value: 10 }
            ],
            /**监测点性质 */
            lineNatureArr: [
                { name: '电网侧', value: 0 },
                { name: '非电网侧', value: 1 }
            ],
            /**项目数据 */
            AddProjectBO: {
                /**项目Id */
                projectIndex: 0,
                /**行政区域Id */
                provinceIndex: 0,
                /**供电公司Id*/
                gdIndex: 0,
                /**变电站Id*/
                subIndex: 0,
                /**设备Id */
                devIndex: 0,
                /**母线ID */
                subvIndex: 0,
                /**项目名称 */
                projectParam: null,
                /**行政区域 */
                provinceParam: null,
                /**供电公司 */
                gdInformationParam: null,
                /**变电站 */
                subStationParam: null,
                /**终端设备   母线  母线下面subVoltage是监测点*/
                deviceParam: null
            },
            areaName: '',
            /**修改项目对象 */
            updateProject: null,
            /**当前选中的节点 */
            nodeData: {},
            /**当前点击节点level,跟节点0*/
            nodeLevel: 0,
            /**状态 1查看 2新增 3修改*/
            pageStatus: 1,
            /**项目Id */
            projectId: 0,
            /**行政区域Id*/
            provinceId: 0,
            /**供电公司Id*/
            gdId: 0,
            /**变电站Id */
            subId: 0,
            /**设备Id */
            devId: 0,
            /**母线Id */
            busBarId: 0,
            /**监测点Id*/
            lineId: 0,
            /**当前选中设备的Index */
            deviceIndex: '0',
            /**当前选中母线的Index */
            busBarIndex: '0',
            /**当选选中监测点的Index */
            lineIndex: '0',
            /**当前供电公司名字 */
            currentGdName: '',
            treeClickCount: '',
            navgatorIndex: 0,
            currentNode: '',
            currentNodeKey: '',
            // currentuuid:[0,1,2,3,4,5,6],
            parentId: null,
            trdata: null,
            trnode: null,
            title100: '',
            title200: '',
            title300: '',
            title400: '',
            title500: '',
            title600: '',
            title700: '',
            level: '',
            changeSelectStyle: null,
            /**IP验证器 */
            arrdess: (rule, value, callback) => {
                let reg1 =
                    /^(\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])$/
                let reg2 =
                    /^[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}$/
                let reg3 =
                    /^[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}$/
                if (reg1.test(value)) {
                    return true
                } else if (reg2.test(value)) {
                    return true
                } else if (reg3.test(value)) {
                    return true
                } else if (value == '') {
                    return callback(new Error('请输入IP/MAC地址'))
                } else {
                    callback(new Error('请输入正确IP/MAC地址'))
                }
            },
            /**经度 */
            lngff: (rule, value, callback) => {
                let reg1 = /^(([1-9]\d?)|(1[0-7]\d))(\.\d{1,6})|180|0(\.\d{1,6})?/
                if (reg1.test(value)) {
                    return true
                } else if (value == '') {
                    return callback(new Error('请输入经度'))
                } else {
                    callback(new Error('请输入正确经度'))
                }
            },
            /**纬度 */
            latff: (rule, value, callback) => {
                let reg2 = /^(\-|\+)?([0-8]?\d{1}\.\d{0,6}|90\.0{0,6}|[0-8]?\d{1}|90)$/
                if (reg2.test(value)) {
                    return true
                } else if (value == '') {
                    return callback(new Error('请输入纬度'))
                } else {
                    callback(new Error('请输入正确纬度'))
                }
            },
            RoutingChanges(id, type) {
                this.treeId = id
                this.$refs.tree.setCurrentKey(id)

                setTimeout(() => {
                    document.querySelector('.is-current').firstChild.click()
                }, 1000)

                //  if (type == "系统对时启动异常") {

                // } else if (type == "时钟出错") {

                // } else if (type == "统计闻隔时间设置出错") {

                // } else if (type == "统计间隔不匹配") {

                // } else if (type == "接线方式不匹配") {

                // } else if (type == "接线方式设置出错") {

                // }
            }
        }
    },
    watch: {
        /**根据名称筛选树 */
        filterText(val) {
            this.$refs.tree.filter(val)
        },
        $route: {
            handler: function (val, oldVal) {
                if (val.params.id != undefined && val.params.type != undefined) {
                    this.RoutingChanges(val.params.id, val.params.type)
                }
            },
            // 深度观察监听
            deep: true
        }
        // currentNodeKey(uuid) {
        // // Tree 内部使用了 Node 类型的对象来包装用户传入的数据，用来保存目前节点的状态。可以用 $refs 获取 Tree 实例
        //   if (uuid.toString()) {
        //     this.$refs["tree"].setCurrentKey(uuid);
        //   } else {
        //     this.$refs["tree"].setCurrentKey(null);
        //   }
        // }
    },
    created() {
        this.treedata()
        this.getFactory()
        this.getDeviceType()
        this.getScale()
        this.getLoadType()
        this.getdayValue()

        this.getIndustryType()
        this.getArea()
        this.getDepartment()
        this.getLineSpace()
        this.getLineNature()
        this.getLineNum()
    },
    mounted() {
        this.setHeight()
        window.addEventListener('resize', this.setHeight)
        this.getAffiliatiedFront()
        this.getFrontType()

        this.bindResize()

        /**
         * 获取下拉选项
         * 注意后端返回数据的格式
         * 除city外-> this.city
         * 定义格式均为[{name: string, value: string}]
         * 如后端返回数据不一样 请自行修改
         */
        if (this.$route.params.id != undefined && this.$route.params.type != undefined) {
            this.RoutingChanges(this.$route.params.id, this.$route.params.type)
        }
    },
    beforeDestroy() {
        window.removeEventListener('resize', this.setHeight)
    },
    methods: {
        setHeight() {
            this.vhh = window.sessionStorage.getItem('appheight') - 50
            this.vh = window.sessionStorage.getItem('appheight') - 10 + 'px'
            this.vmh = window.sessionStorage.getItem('appheight') - 10 + 'px'
            this.vth = window.sessionStorage.getItem('appheight') - 60 + 'px'
        },

        handNodeClicktree(data, node, nodeData) {
            //alert(data)
            //  console.log(data,node)
            this.provinceIndex = data

            this.provinceIndex = data.id
            this.AddProjectBO.provinceParam.name = data.id
            this.areaName = data.name
            // this.$refs.tree.blur();
        },
        topath(selector, val) {
            // console.log(this.$el.querySelector(selector))
            this.$el.querySelector(selector).scrollIntoView({
                behavior: 'smooth', // 平滑过渡
                block: 'start' // 上边框与视窗顶部平齐
            })
            this.changeSelectStyle = val
        },
        /**筛选节点 */
        filterNode(value, data, node) {
            if (!value) {
                return true
            }
            let _array = [] //这里使用数组存储 只是为了存储值。
            this.getReturnNode(node, _array, value)
            let result = false
            _array.forEach(item => {
                result = result || item
            })
            return result
        },
        getReturnNode(node, _array, value) {
            let isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1
            isPass ? _array.push(isPass) : ''
            this.index++
            if (!isPass && node.name != 1 && node.parent) {
                this.getReturnNode(node.parent, _array, value)
            }
        },
        /**
         * 缩放条拖动进而改变左侧div宽度方法
         */
        bindResize() {
            /**开始坐标 */
            let startX
            /**开始宽度 */
            let startWidth = getScalableDivWidth()

            document.querySelector('#drag-dept').addEventListener('mousedown', startDrag)

            function startDrag(e) {
                startX = e.clientX
                startWidth = getScalableDivWidth()

                document.documentElement.addEventListener('mousemove', onDrag)
                document.documentElement.addEventListener('mouseup', stopDrag)
            }

            function onDrag(e) {
                let newWidth = startWidth + e.clientX - startX
                document.querySelector('#drag-dept-left').style.width = newWidth + 'px'
            }

            function stopDrag() {
                document.documentElement.removeEventListener('mousemove', onDrag)
                document.documentElement.removeEventListener('mouseup', stopDrag)
            }

            /**获取宽度 */
            function getScalableDivWidth() {
                return parseInt(window.getComputedStyle(document.querySelector('#drag-dept-left')).width, 10)
            }
        },
        /**
         * 获取树结构
         */
        async treedata() {
            this.uuid = 0
            await api.tree().then(response => {
                var treeMenus = []
                // this.$refs["tree"].setCurrentKey(this.currentNode);
                //let node=  this.$refs.tree.getNode()
                //this.handleNodeClick(data, node)
                //window.uuid=0
                this.expanded = [response.data[0].id, response.data[0].children[0].id]
                treeMenus = response.data
                this.expanded.push()
                treeMenus.forEach(m => {
                    m.level = 0
                    m.icon = 'el-icon-menu'
                    m.children.forEach(n => {
                        n.level = 100
                        n.icon = 'el-icon-s-home'
                        n.children.forEach(o => {
                            o.level = 200
                            o.icon = 'el-icon-collection-tag'
                            o.children.forEach(p => {
                                p.level = 300
                                p.icon = 'el-icon-s-flag'
                                p.children.forEach(q => {
                                    q.level = 400
                                    q.icon = 'el-icon-office-building'
                                    q.children.forEach(r => {
                                        r.level = 500
                                        r.icon = 'el-icon-film'
                                        r.children.forEach(s => {
                                            s.level = 600
                                            s.icon = 'el-icon-share'
                                            s.children.forEach(t => {
                                                t.level = 700
                                                t.icon = 'el-icon-map-location'
                                            })
                                        })
                                    })
                                })
                            })
                        })
                    })
                })
                this.test_parse(treeMenus)
                // console.log("测试",treeMenus)
                this.treeMenus = treeMenus
                if (this.trnode) {
                    this.handleNodeClick(this.trdata, this.trnode)
                } else {
                    return
                }
            })
            setTimeout(() => {
                this.$refs.tree.setCurrentKey(this.treeId)
                if (this.treeId != '') {
                    setTimeout(() => {
                        //  console.log(123123,document.querySelector(".is-current").offsetTop);
                        document.getElementById('menuTree').scrollTo({
                            top: 100,
                            behavior: 'smooth'
                        })
                    }, 10)
                }
            }, 0)
        },

        test_parse(treeMenus) {
            for (var key in treeMenus) {
                ///console.log(treeMenus[key])
                treeMenus[key].uuid = this.uuid++
                if (treeMenus[key].children) {
                    this.test_parse(treeMenus[key].children)
                }
            }
        },
        /**
         * 点击节点回调
         * @param data 传递给 data 属性的数组中该节点所对应的对象
         * @param node 节点对应的 Node
         */
        handleNodeClick(data, node) {
            this.treeId = data.id
            this.pid = data.pid
            this.trdata = data
            this.trnode = node
            // console.log(data.level)
            // data为被点击节点数据
            // 记录点树节点击次数
            this.treeClickCount++
            if (this.treeClickCount > 2) return
            setTimeout(() => {
                if (this.treeClickCount == 1) {
                    // 进行单击事件处理
                    // console.log('单击事件', data)
                    // 进行双击事件处理

                    if (this.pageStatus == 2 || this.pageStatus == 3) {
                        if (this.pageStatus == 3 || this.pageStatus == 2) {
                            this.$message({
                                type: 'warning',
                                message: '请先提交,再做操作'
                            })
                        }
                        return
                    }
                    this.currentNode = 0
                    this.pageStatus = 1
                    this.nodeData = node
                    this.level = node.data.level
                    if (node.data.level == 0) {
                        this.title0 = node.data.name
                    } else if (node.data.level == 100) {
                        this.title100 = node.data.name
                        // this.title200=node.parent.data.name
                    } else if (node.data.level == 200) {
                        this.title200 = node.data.name
                        this.title100 = node.parent.data.name
                    } else if (node.data.level == 300) {
                        this.title300 = node.data.name
                        this.title200 = node.parent.data.name
                        this.title100 = node.parent.parent.data.name
                    } else if (node.data.level == 400) {
                        this.title400 = node.data.name
                        this.title300 = node.parent.data.name
                        this.title200 = node.parent.parent.data.name
                        this.title100 = node.parent.parent.parent.data.name
                    } else if (node.data.level == 500) {
                        this.title500 = node.data.name
                        this.title400 = node.parent.data.name
                        this.title300 = node.parent.parent.data.name
                        this.title200 = node.parent.parent.parent.data.name
                        this.title100 = node.parent.parent.parent.parent.data.name
                    } else if (node.data.level == 600) {
                        this.title600 = node.data.name
                        this.title500 = node.parent.data.name
                        this.title400 = node.parent.parent.data.name
                        this.title300 = node.parent.parent.parent.data.name
                        this.title200 = node.parent.parent.parent.parent.data.name
                        this.title100 = node.parent.parent.parent.parent.parent.data.name
                    } else if (node.data.level == 700) {
                        this.title700 = node.data.name
                        this.title600 = node.parent.data.name
                        this.title500 = node.parent.parent.data.name
                        this.title400 = node.parent.parent.parent.data.name
                        this.title300 = node.parent.parent.parent.parent.data.name
                        this.title200 = node.parent.parent.parent.parent.parent.data.name
                        this.title100 = node.parent.parent.parent.parent.parent.parent.data.name
                    }

                    this.currentNode = node.data.uuid
                    this.currentuuid = node.data.uuid
                    // this.parentId =node.data.parentId
                    this.nodeLevel = data.level
                    //8-17

                    this.AddProjectBO.projectParam = null
                    this.AddProjectBO.provinceParam = null
                    this.AddProjectBO.gdInformationParam = null
                    this.AddProjectBO.subStationParam = null
                    this.AddProjectBO.deviceParam = null

                    this.evaluate(node)
                    if (data.level > 400) {
                        this.getNodeIndex(node, data.level)
                    }
                    /**不是根节点请求数据 */
                    if (this.nodeLevel) {
                        this.queryNodeContent()
                    } else {
                        /**清空数据 */
                        this.initAddProjectBo()
                        this.initAddProjectBoId()
                    }
                } else if (this.treeClickCount == 2) {
                    //console.log('双击事件', data)
                }
                this.treeClickCount = 0
            }, 500)

            // this.navgatorIndex =  this.nodeLevel;

            // this.$el.querySelector(`#id${ this.nodeLevel}`).scrollIntoView({
            //   behavior: "smooth",  // 平滑过渡
            //   block:    "start"  // 上边框与视窗顶部平齐。默认值
            // });
        },
        black() {
            this.pageStatus = 1
        },
        /**
         * 选中回调
         * @param string type
         * deviceIndex 设备切换
         * busBarIndex 母线切换
         * lineIndex 监测点切换
         */
        tabChange(type) {
            if (type == 'deviceIndex') {
                this.busBarIndex = '0'
                this.lineIndex = '0'
                //this.busBarIndex = 0;
                // this.lineIndex = 0;
            } else if (type == 'busBarIndex') {
                this.lineIndex = '0'
                // this.lineIndex = 0;
            }
        },
        /**
         * 根据节点获取在设备 母线 监测点的Index
         * @param object node  节点
         * @param object level 节点等级
         */
        getNodeIndex(node, level) {
            // if (level == 500) {
            //   this.deviceIndex = node.parent.data.children.findIndex((item) => item.id == node.data.id) + "";
            // //this.deviceIndex = node.parent.data.children.findIndex((item) => item.id == node.data.id);
            // }
            // if (level == 600) {
            //   this.busBarIndex = node.parent.data.children.findIndex((item) => item.id == node.data.id) + "";
            //  // this.busBarIndex = node.parent.data.children.findIndex((item) => item.id == node.data.id);
            //  // this.getNodeIndex(node.parent, node.parent.data.level);
            // }
            // if (level == 700) {
            //   this.lineIndex = node.parent.data.children.findIndex((item) => item.id == node.data.id) + "";
            //   //this.lineIndex = node.parent.data.children.findIndex((item) => item.id == node.data.id);
            //   this.getNodeIndex(node.parent, node.parent.data.level);
            // }

            this.deviceIndex = '0'
            this.busBarIndex = '0'
            this.lineIndex = '0'
        },
        /**
         * 递归赋值父节点Id
         */
        evaluate(node) {
            switch (node.data.level) {
                case 100:
                    this.projectId = node.data.id
                    break
                case 200:
                    this.provinceId = node.data.id
                    break
                case 300:
                    this.gdId = node.data.id
                    break
                case 400:
                    this.subId = node.data.id
                    break
                case 500:
                    this.devId = node.data.id
                    break
                case 600:
                    this.busBarId = node.data.id
                    break
                case 700:
                    this.lineId = node.data.id
                    break
            }
            if (node.parent) {
                this.evaluate(node.parent)
            }
        },
        /**查询节点内容 */
        queryNodeContent() {
            let data = {
                id: this.nodeData.data.id,
                level: this.nodeLevel
            }
            api.query(data).then(res => {
                // console.log("内容详情", res);
                if (this.nodeLevel === 500) {
                    var data = res.data
                    /**假数据 */
                    var arr = []
                    var arr1 = []
                    //取设备
                    for (var i = 0; i < data.deviceVO.length; i++) {
                        //判断母线是否存在
                        //   if(data.deviceVO[0].subVoltageVOList !=null){
                        //     //存在
                        //      for(var j=0;j<data.deviceVO[0].subVoltageVOList.length;j++){
                        //        //取出已经使用母线编号
                        //      arr.push(data.deviceVO[0].subVoltageVOList[j].num)
                        //      //过滤已经使用的母线编号
                        //       for(var z=0;z<this.optionarr.length;z++){
                        //         for(var h=0;h<arr.length;h++){
                        //           if(this.optionarr[z].value==arr[h]){
                        //               this.optionarr.splice(i, 1)
                        //           }
                        //         }
                        //       }
                        //      //判断监测点是否存在
                        //      if(data.deviceVO[0].subVoltageVOList[j].lineVO!=null){
                        //          //存在
                        //      for(var p=0;p<data.deviceVO[0].subVoltageVOList[j].lineVO.length;p++){
                        //        //取出已经使用的监测点号
                        //        arr1.push(data.deviceVO[0].subVoltageVOList[j].lineVO[p].num)
                        //      }
                        //          console.log(this.pointNumArr.length)
                        //     for(var i=0;i<this.pointNumArr.length;i++){
                        //       for(var j=0;j<arr1.length;j++){
                        //         if(this.pointNumArr[i].value===arr1[j]){
                        //           this.pointNumArr.splice(i, 1)
                        //         }
                        //       }
                        //    }
                        //   }else{
                        //      this.pointNumArr = [
                        //        {name: "1", value: 1},
                        //         {name: "2", value: 2},
                        //         {name: "3", value: 3},
                        //         {name: "4", value: 4},
                        //         {name: "5", value: 5},
                        //         {name: "6", value: 6}]
                        //   }
                        // }
                        //    }else{
                        //      this.optionarr=[
                        //        {name:'1号母线',value:1},
                        //        {name:'2号母线',value:2},
                        //        {name:'3号母线',value:3},
                        //        {name:'4号母线',value:4},
                        //        {name:'5号母线',value:5},
                        //        {name:'6号母线',value:6}]
                        //    }
                    }

                    //alert(arr)
                }
                /**对接口再放开 */
                this.AddProjectBO.projectIndex =
                    res.data.projectVO && res.data.projectVO.projectIndex ? res.data.projectVO.projectIndex : 0
                this.AddProjectBO.provinceIndex =
                    res.data.provinceVO && res.data.provinceVO.provinceIndex ? res.data.provinceVO.provinceIndex : 0
                this.AddProjectBO.gdIndex =
                    res.data.gdInformationVO && res.data.gdInformationVO.gdIndex ? res.data.gdInformationVO.gdIndex : 0
                this.AddProjectBO.subIndex =
                    res.data.subStationVO && res.data.subStationVO.subIndex ? res.data.subStationVO.subIndex : 0

                this.AddProjectBO.projectParam = {
                    name: res.data.projectVO.name,
                    sort: res.data.projectVO.sort
                }

                if (this.nodeLevel > 100) {
                    // this.AddProjectBO.provinceIndex = res.data.provinceVO.name
                    this.AddProjectBO.provinceParam = {
                        name: res.data.provinceVO.name,
                        sort: res.data.provinceVO.sort
                    }
                    // this.areaName=res.data.provinceVO.name
                    this.treeOptions.forEach(m => {
                        if (m.id == res.data.provinceVO.name) {
                            this.areaName = m.name
                        }
                    })
                }

                if (this.nodeLevel > 200) {
                    this.AddProjectBO.gdInformationParam = {
                        name: res.data.gdInformationVO.name,
                        sort: res.data.gdInformationVO.sort
                    }
                    this.currentGdName = res.data.gdInformationVO.name
                }

                if (this.nodeLevel > 300) {
                    this.AddProjectBO.subStationParam = this.removeRefer(res.data.subStationVO)
                    let deviceBO = this.removeRefer(res.data.deviceVO)
                    deviceBO.forEach(item => {
                        item.subVoltageParam = item.subVoltageVOList ? item.subVoltageVOList : []
                        delete item.subVoltageVOList
                        item.subVoltageParam.forEach(litem => {
                            litem.lineParam = litem.lineVO ? litem.lineVO : []
                            delete litem.lineVO
                        })
                    })
                    this.AddProjectBO.deviceParam = this.removeRefer(deviceBO)
                    deviceBO = null
                    // this.goToAnchor('#id'+this.nodeLevel)
                }
                //  console.log(this.AddProjectBO);
                //  console.log(this.deviceIndex);

                // this.currentGdName = this.AddProjectBO.gdInformationBO.name;
            })
        },
        /**
         * 新增
         */
        add() {
            // if (Object.keys(this.nodeData).length == 0) {
            //   this.$message({
            //     type: "warning",
            //     message: "没有选中节点",
            //   });
            //   return;
            // }
            if (this.pageStatus == 2 || this.pageStatus == 3) {
                if (this.pageStatus == 3) {
                    this.$message({
                        type: 'warning',
                        message: '请先提交修改,再新增'
                    })
                }
                return
            }
            this.pageStatus = 2
            /**删除Id属性 */
            delete this.AddProjectBO.projectIndex
            delete this.AddProjectBO.provinceIndex
            delete this.AddProjectBO.gdIndex
            delete this.AddProjectBO.subIndex
            delete this.AddProjectBO.devIndex
            delete this.AddProjectBO.subvIndex
            // switch (this.nodeData.data.level) {
            switch (this.nodeLevel) {
                case 0:
                    this.addProject()
                    break
                case 100:
                    this.initAddProjectBo()
                    this.AddProjectBO.projectIndex = this.projectId
                    this.addProvince()
                    break
                case 200:
                    this.initAddProjectBo()
                    this.AddProjectBO.projectIndex = this.projectId
                    this.AddProjectBO.provinceIndex = this.provinceId
                    this.addGdInformation()
                    break
                case 300:
                    this.initAddProjectBo()
                    this.AddProjectBO.projectIndex = this.projectId
                    this.AddProjectBO.provinceIndex = this.provinceId
                    this.AddProjectBO.gdIndex = this.gdId
                    this.addSubStation()
                    break
                case 400:
                    this.initAddProjectBo()
                    this.AddProjectBO.projectIndex = this.projectId
                    this.AddProjectBO.provinceIndex = this.provinceId
                    this.AddProjectBO.gdIndex = this.gdId
                    this.AddProjectBO.subIndex = this.subId
                    this.addDevice()
                    break
                case 500:
                    this.AddProjectBO.projectIndex = this.projectId
                    this.AddProjectBO.provinceIndex = this.provinceId
                    this.AddProjectBO.gdIndex = this.gdId
                    this.AddProjectBO.subIndex = this.subId
                    this.AddProjectBO.devIndex = this.devId
                    //this.AddProjectBO.projectParam = null;
                    //this.AddProjectBO.provinceParam = null;
                    //this.AddProjectBO.gdInformationParam = null;
                    //this.AddProjectBO.subStationParam = null;
                    this.addSubVoltage()
                    break
                case 600:
                    this.AddProjectBO.projectIndex = this.projectId
                    this.AddProjectBO.provinceIndex = this.provinceId
                    this.AddProjectBO.gdIndex = this.gdId
                    this.AddProjectBO.subIndex = this.subId
                    this.AddProjectBO.devIndex = this.devId
                    this.AddProjectBO.subvIndex = this.busBarId
                    // this.AddProjectBO.projectParam = null;
                    // this.AddProjectBO.provinceParam = null;
                    // this.AddProjectBO.gdInformationParam = null;
                    // this.AddProjectBO.subStationParam = null;
                    this.addLine()
                    break
                case 700:
                    this.AddProjectBO.projectIndex = this.projectId
                    this.AddProjectBO.provinceIndex = this.provinceId
                    this.AddProjectBO.gdIndex = this.gdId
                    this.AddProjectBO.subIndex = this.subId
                    this.AddProjectBO.devIndex = this.devId
                    this.AddProjectBO.subvIndex = this.busBarId
                    // this.AddProjectBO.projectParam = null;
                    // this.AddProjectBO.provinceParam = null;
                    // this.AddProjectBO.gdInformationParam = null;
                    // this.AddProjectBO.subStationParam = null;
                    this.addLine()
                    break
            }
            this.deviceBODetail.manufacturer = this.factoryArr[0].value
            this.deviceBODetail.devType = this.typeArr[0].value
            this.deviceBODetail.frontType = this.comTypeStatusArr[0].value
            this.deviceBODetail.nodeId = this.affiliatiedFrontArr[0].id
            this.busBarDetail.scale = this.voltageLevelArr[0].id
            this.subStationParam.scale = this.voltageLevelArr[0].id
            this.monitorPointDetail.businessType = this.industryTypeArr[0].value
            this.monitorPointDetail.loadType = this.loadTypeArr[0].id
        },
        /**新增项目 */
        addProject() {
            this.nodeLevel = 100
            this.AddProjectBO.projectParam = this.removeRefer(this.projectParam)
        },
        /**
         * 新增行政区域
         */
        addProvince() {
            this.nodeLevel = 200
            this.AddProjectBO.provinceParam = this.removeRefer(this.provinceParam)
        },
        /**
         * 新增供电公司
         */
        addGdInformation() {
            this.nodeLevel = 300
            this.AddProjectBO.gdInformationParam = this.removeRefer(this.gdInformationParam)
        },
        /**
         * 新增变电站
         */
        addSubStation() {
            this.nodeLevel = 400
            this.AddProjectBO.subStationParam = this.removeRefer(this.subStationParam)
        },
        /**
         * 新增设备
         */
        addDevice() {
            this.nodeLevel = 500
            // 不存在，赋值
            if (!this.AddProjectBO.deviceParam) {
                this.AddProjectBO.deviceParam = this.removeRefer(this.deviceParam)
            }

            const device = this.removeRefer(this.deviceBODetail)
            device.gdName = this.currentGdName

            this.AddProjectBO.deviceParam.push(this.removeRefer(device))
            this.deviceIndex = this.AddProjectBO.deviceParam.length - 1 + ''
            //this.deviceIndex = this.AddProjectBO.deviceBO.length - 1;
        },
        /**
         * 新增母线
         */
        addSubVoltage() {
            this.nodeLevel = 600
            this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam.push(this.removeRefer(this.busBarDetail))
            this.busBarIndex = this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam.length - 1 + ''
            //7-30
            // this.AddProjectBO.deviceBO.forEach(item => {
            // if (!item.subVoltageDTOList) {
            //   item.subVoltage=[]
            //    delete item.subVoltageDTOList;
            // }})
            //7-30
            // this.AddProjectBO.deviceBO[this.deviceIndex].subVoltage.push(this.removeRefer(this.busBarDetail));
            //this.busBarIndex = this.AddProjectBO.deviceBO[this.deviceIndex].subVoltage.length - 1 + "";
            // this.busBarIndex = this.AddProjectBO.deviceBO[this.deviceIndex].subVoltage.length - 1;
        },
        /**
         * 新增监测点
         */
        addLine() {
            this.nodeLevel = 700
            //7-30
            //  this.AddProjectBO.deviceBO.forEach(item => {
            //       if (!item.subVoltageDTOList) {
            //          delete item.subVoltageDTOList;
            //         item.subVoltage = []
            //           item.subVoltage.forEach(lineItem => {
            //             if (!lineItem.lineDTO) {
            //             delete lineItem.lineDTO;
            //               lineItem.line = []
            //            }
            //         })
            //       }
            //     })
            //7-30
            this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam.push(
                this.removeRefer(this.monitorPointDetail)
            )
            //this.lineIndex = this.AddProjectBO.deviceBO[this.deviceIndex].subVoltage[this.busBarIndex].line.length - 1 + "";
            this.lineIndex =
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam.length -
                1 +
                ''
        },
        /**
         * 下一步
         */
        next() {
            // debugger
            switch (this.nodeLevel) {
                case 100:
                    this.addProvince()
                    this.nextfalg = false
                    this.title100 = this.trnode.data.name
                    break
                case 200:
                    this.addGdInformation()
                    this.nextfalg = false
                    this.title200 = this.trnode.data.name
                    break
                case 300:
                    this.addSubStation()
                    this.nextfalg = false
                    this.title300 = this.trnode.data.name
                    break
                case 400:
                    this.addDevice()
                    this.nextfalg = false
                    this.title400 = this.trnode.data.name

                    break
                case 500:
                    this.addSubVoltage()
                    this.nextfalg = false
                    this.title500 = this.trnode.data.name

                    break
                case 600:
                    this.addLine()
                    this.nextfalg = false
                    this.title600 = this.trnode.data.name
                    break
                case 700:
                    this.addLine()
                    this.nextfalg = true
                    this.title700 = this.trnode.data.name
                    break
            }
        },
        /**
         * 修改
         */
        update() {
            if (Object.keys(this.nodeData).length == 0) {
                this.$message({
                    type: 'warning',
                    message: '没有选中节点'
                })
                return
            }
            if (this.nodeData.data.level == 0) {
                this.$message({
                    type: 'warning',
                    message: '不能修改根节点'
                })
                return
            }
            if (this.pageStatus == 2 || this.pageStatus == 3) {
                if (this.pageStatus == 2) {
                    this.$message({
                        type: 'warning',
                        message: '请先新增完成在修改'
                    })
                }
                return
            }

            this.pageStatus = 3
        },
        /**
         * 修改项目
         */
        updateProjectF() {
            this.updateProject = {
                projectUpdateParam: {
                    name: this.AddProjectBO.projectParam.name,
                    projectIndex: this.projectId,
                    sort: this.AddProjectBO.projectParam.sort,
                    updateFlag: 1
                }
            }
        },
        /**
         * 修改行政区域
         */
        updateProvince() {
            this.updateProject = {
                provinceUpdateParam: {
                    name: this.AddProjectBO.provinceParam.name,
                    provinceIndex: this.AddProjectBO.provinceIndex,
                    sort: this.AddProjectBO.provinceParam.sort,
                    updateFlag: 1
                }
            }
        },
        /**
         * 修改供电公司
         */
        updateGdInformation() {
            this.updateProject = {
                gdInformationUpdateParam: {
                    name: this.AddProjectBO.gdInformationParam.name,
                    sort: this.AddProjectBO.gdInformationParam.sort,
                    gdIndex: this.gdId,
                    updateFlag: 1
                }
            }
        },
        /**
         * 修改变电站
         */
        updateSubStation() {
            this.updateProject = {
                subStationUpdateParam: {
                    name: this.AddProjectBO.subStationParam.name,
                    lat: this.AddProjectBO.subStationParam.lat,
                    lng: this.AddProjectBO.subStationParam.lng,
                    scale: this.AddProjectBO.subStationParam.scale,
                    subIndex: this.subId,
                    sort: this.AddProjectBO.subStationParam.sort,
                    updateFlag: 1
                }
            }
        },
        /**
         * 修改变设备/母线/监测点
         */
        updateDevice() {
            /**生成数据 */
            const devices = this.removeRefer(this.AddProjectBO.deviceParam)
            devices.forEach(item => {
                item.updateFlag = 1
                item.subVoltageParam = item.subVoltageParam
                // delete item.subVoltageParam;
                item.subVoltageParam.forEach(bus => {
                    bus.updateFlag = 1
                    bus.lineParam = bus.lineParam
                    //delete bus.lineParam;
                    bus.lineParam.forEach(line => {
                        line.updateFlag = 1
                    })
                })
            })
            this.updateProject = {
                deviceUpdateParamList: devices
            }
        },
        /**
         * 确认提交
         */
        onsubmit() {
            //  this.$refs["mainForm"].validate((valid) => {
            /**验证通过 */
            // if (valid) {
            if (this.pageStatus == 2) {
                // 新增
                this.submitData()
            } else {
                // 修改
                switch (this.nodeLevel) {
                    case 100:
                        this.updateProjectF()
                        break
                    case 200:
                        this.updateProvince()
                        break
                    case 300:
                        this.updateGdInformation()
                        break
                    case 400:
                        this.updateSubStation()
                        break
                    case 500:
                    case 600:
                    case 700:
                        this.updateDevice()
                        break
                }
                this.updateDate()
            }

            //   } else {
            //  return false;
            //  }
            // });
        },
        /**
         * 提交数据
         */
        submitData() {
            // if(this.AddProjectBO.projectInde!=0 ){
            //      this.AddProjectBO.projectParam=null
            // }
            const project = this.removeRefer(this.AddProjectBO)
            // let data={
            //     AddProjectBO: project,
            //   }
            project: JSON.stringify(project)
            api.add(project).then(res => {
                this.$message({
                    type: 'success',
                    message: res.message
                })
                this.reaseStatus()
                this.initAddProjectBo()
                this.initAddProjectBoId()
                this.treedata()
            })
        },
        /**
         * 修改数据
         */
        updateDate() {
            // console.log("updateProject:", this.updateProject);
            let data = this.updateProject
            api.updateTerminal(data).then(res => {
                this.$message({
                    type: 'success',
                    message: res.message
                })
                this.pageStatus = 1
                this.treedata()
            })
        },
        /**
         * 删除
         */
        remove() {
            if (Object.keys(this.nodeData).length == 0) {
                this.$message({
                    type: 'warning',
                    message: '没有选中节点'
                })
                return
            }
            if (this.nodeData.data.level == 0) {
                this.$message({
                    type: 'error',
                    message: '无法删除根节点'
                })
                return
            }
            this.$confirm('此操作将永久删除, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
                    let data = {
                        id: this.nodeData.data.id,
                        level: this.nodeData.data.level
                    }
                    api.deleteById(data).then(res => {
                        this.$message({
                            type: 'success',
                            message: res.message
                        })
                        this.reaseStatus()
                        this.initAddProjectBo()
                        this.initAddProjectBoId()
                        this.treedata()
                    })
                })
                .catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    })
                })
        },
        /**
         * 新增/删除设备
         */
        handleDeviceTabsEdit(targetName, action) {
            // console.log(targetName);
            /**新增 */
            if (action === 'add') {
                this.addDevice()
            }
            /**删除 */
            if (action === 'remove') {
                this.$confirm('此操作将永久删除, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                })
                    .then(() => {
                        if (this.AddProjectBO.deviceParam[this.deviceIndex].devIndex) {
                            let data = {
                                id: this.AddProjectBO.deviceParam[this.deviceIndex].devIndex,
                                level: 500
                            }
                            api.deleteById(data).then(res => {
                                this.$message({
                                    type: 'success',
                                    message: res.message
                                })
                                this.reaseStatus()
                                this.initAddProjectBo()
                                this.initAddProjectBoId()
                                this.treedata()
                            })
                        } else {
                            this.AddProjectBO.deviceParam.splice(this.deviceIndex, 1)
                            this.deviceIndex = this.AddProjectBO.deviceParam.length
                                ? this.AddProjectBO.deviceParam.length - 1 + ''
                                : '0'
                            this.busBarIndex = '0'
                            this.lineIndex = '0'
                            this.$message({
                                type: 'success',
                                message: '删除成功'
                            })
                        }
                    })
                    .catch(() => {
                        this.$message({
                            type: 'info',
                            message: '已取消删除'
                        })
                    })
            }
        },
        /**
         * 新增/删除母线
         */
        handleBusBarTabsEdit(targetName, action) {
            // console.log(targetName);
            /**新增 */
            if (action === 'add') {
                this.addSubVoltage()
            }
            /**删除 */
            if (action === 'remove') {
                this.$confirm('此操作将永久删除, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                })
                    .then(() => {
                        if (
                            this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].subvIndex
                        ) {
                            let data = {
                                id: this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex]
                                    .subvIndex,
                                level: 600
                            }
                            api.deleteById(data).then(res => {
                                this.$message({
                                    type: 'success',
                                    message: res.message
                                })
                                this.reaseStatus()
                                this.initAddProjectBo()
                                this.initAddProjectBoId()
                                this.treedata()
                            })
                        } else {
                            this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam.splice(this.busBarIndex, 1)
                            this.busBarIndex = this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam.length
                                ? this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam.length - 1 + ''
                                : '0'
                            this.lineIndex = '0'
                            this.$message({
                                type: 'success',
                                message: '删除成功'
                            })
                        }
                    })
                    .catch(() => {
                        this.$message({
                            type: 'info',
                            message: '已取消删除'
                        })
                    })
            }
        },
        /**
         * 新增/删除监测点
         */
        handleLineTabsEdit(targetName, action) {
            // console.log("targetName:", targetName);
            /**新增 */
            if (action === 'add') {
                if (
                    this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam
                        .length == 6
                ) {
                    this.$message({
                        type: 'warning',
                        message: '不能新增更多的监测点了'
                    })
                    return
                }

                this.addLine()
            }
            /**删除 */
            if (action === 'remove') {
                this.$confirm('此操作将永久删除, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                })
                    .then(() => {
                        if (
                            this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[
                                this.lineIndex
                            ].lineIndex
                        ) {
                            let data = {
                                id: this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex]
                                    .lineParam[this.lineIndex].lineIndex,
                                level: 700
                            }
                            api.deleteById(data).then(res => {
                                this.$message({
                                    type: 'success',
                                    message: res.message
                                })
                                this.reaseStatus()
                                this.initAddProjectBo()
                                this.initAddProjectBoId()
                                this.treedata()
                            })
                        } else {
                            this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                                this.busBarIndex
                            ].lineParam.splice(this.lineIndex, 1)
                            this.lineIndex = this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                                this.busBarIndex
                            ].lineParam.length
                                ? this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex]
                                    .lineParam.length -
                                1 +
                                ''
                                : '0'
                            this.$message({
                                type: 'success',
                                message: '删除成功'
                            })
                        }
                    })
                    .catch(() => {
                        this.$message({
                            type: 'info',
                            message: '已取消删除'
                        })
                    })
            }
        },

        selectChanged(value) {
            //  this.$confirm("此操作将修改监测点相关配置, 是否继续?", "提示", {
            //   confirmButtonText: "确定",
            //   cancelButtonText: "取消",
            //   type: "warning",
            // }).then(() => {
            //    this.$message({
            //         type: "success",
            //         message: '操作电压等级成功',
            //           });
            //  }).catch(() => {
            //       this.$message({
            //         type: "info",
            //         message: "已取消操作",
            //       });
            //     });

            // const { value, label } = params
            // console.log("+++++++++++++++++++++++++",value)
            // alert(value)
            //0.38kv
            if (value === '3d68ceef26a579efe2fe0cdc654911b7') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 10
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    0.38 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    0.38 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 10
                //750kv
            } else if (value === '4cf2d844c47a15a1c16a65b4bbfd1b0e') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 7000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    750 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    750 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 7000
                //6kv
            } else if (value === '37b81bf8aa0fd54098716da3fc0ee433') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    6 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    6 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 100
                //10kv
            } else if (value === 'e3da890104e3c4ae1f005021411a1fd7') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    10 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    10 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 100
                //20kv
            } else if (value === '87065e15765e5899114a6d6b9e4fb3cb') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 200
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    20 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    20 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 200
                //35kv
            } else if (value === '8529cfa11356a0666afd3f9fa4da09a4') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 250
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    35 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    35 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 250
                //66kv
            } else if (value === '9ce75596a3368da4adf3374b4fc3b619') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 500
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    66 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    66 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 500
                //110kv
            } else if (value === 'e96d74b79bd50ad0bc00a405246f1e1f') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 750
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    110 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    110 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 750
                //220kv
            } else if (value === '1b7b58ed8fcc2992b95334eaa9010c41') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 2000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    220 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    220 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 2000
                //330kv
            } else if (value === 'c1b37350a67f5e229a1f96ace0ad04dc') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 3000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    330 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    330 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 3000
                //500kv
            } else if (value === '1fa650685c77db1656c70f9db4a2edc6') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 4500
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    500 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    500 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 4500
                //1000kv
            } else if (value === '674cf02fb3fcfd9f99fd786cfca090df') {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 9000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt1 =
                    1000 * 1000
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[this.busBarIndex].lineParam[0].pt2 =
                    1000 * 100
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 9000
            } else {
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].standardCapacity = 10
                this.AddProjectBO.deviceParam[this.deviceIndex].subVoltageParam[
                    this.busBarIndex
                ].lineParam[0].shortCapacity = 10
            }
        },

        //时间格式
        getdayValue() {
            var data = new Date()
            var year = data.getFullYear()
            var month = data.getMonth()
            if (month + 1 >= 10) {
                month = month + 1
            } else {
                month = '0' + (month + 1)
            }
            var day = data.getDate()
            if (day + 1 >= 10) {
                day = day + 1
            } else {
                day = '0' + (day + 1)
            }
            this.deviceBODetail.thisTimeCheck = year + '-' + month + '-' + day
            this.deviceBODetail.loginTime = year + '-' + month + '-' + day
            this.deviceBODetail.updateTime = year + '-' + month + '-' + day
            this.deviceBODetail.nextTimeCheck =
                year + 1 + '-' + month + '-' + (day - 1 > 10 ? day - 1 : '0' + (day - 1))
            //this.deviceBODetail.nextTimeCheck = new Date(2025, mymonth, myweekday);
        },
        /**
         * 获取厂家
         */
        getFactory() {
            let code = 'Dev_Manufacturers'
            this.factoryArr = dicData(code, [])
            this.manufacturer = this.factoryArr[0].value
        },
        /**
         * 获取设备型号
         */
        getDeviceType() {
            let code = 'Dev_Type'
            this.typeArr = dicData(code, [])
            this.deviceBODetail.devType = this.typeArr[0].value
        },

        /**
         * 获取前置机
         */
        getAffiliatiedFront() {
            api.nodelist().then(res => {
                // console.log("前置机", res);
                this.affiliatiedFrontArr = res.data
                this.deviceBODetail.nodeId = this.affiliatiedFrontArr[0].id
            })
        },
        /**
         * 获取前置类型
         */
        getFrontType() {
            var code = 'Front_Type'
            this.comTypeStatusArr = dicData(code, [])
            this.frontType = this.comTypeStatusArr[0].value
            //console.log('++++++++++++++++++'+ this.frontType)
        },
        /**
         * 获取电压等级
         */
        getScale() {
            let code = 'Dev_Voltage_Stand'
            this.voltageLevelArr = dicData(code, [])
            this.busBarDetail.scale = this.voltageLevelArr[0].id
        },
        /**
         * 获取干扰源类型
         */
        getLoadType() {
            var code = 'Interference_Source'
            this.loadTypeArr = dicData(code, [])
        },

        /**
         * 获取行业类型
         */
        getIndustryType() {
            var code = 'Business_Type'
            this.industryTypeArr = dicData(code, [])
        },
        /**
         * 获取行政区域
         */
        getArea() {
            var data = { id: '', type: 0 }
            JSON.stringify(data)
            api.areaTree(data).then(response => {
                this.treeOptions = response.data
                this.treeOptions.forEach(m => {
                    this.idArr2.push(m.id)
                })
            })
        },
        /**
         * 获取部门
         */
        change(value) {
            //alert(value)
            let id = value
            // this.getDepartment(id)
        },
        getDepartment(id) {
            // api.dept(id).then((res) => {
            //   console.log("部门", res);
            //  this.departmentArr = res.data;
            // });
        },
        /**
         * 获取测量点序号
         */
        getLineNum() {
            // http({
            //   url: "/device-boot/terminalTree/getTerminalTree",
            //   method: "get",
            //   data: {
            //     dictypeName: "序号",
            //   },
            // }).then((res) => {
            //   console.log("序号", res);
            // this.pointNumArr = res.data;
            // });
        },
        /**
         * 获取测量点间隔
         */
        getLineSpace() {
            // http({
            //   url: "/device-boot/terminalTree/getTerminalTree",
            //   method: "get",
            //   data: {
            //     dictypeName: "间隔",
            //   },
            // }).then((res) => {
            //   console.log("间隔", res);
            // this.lineSpaceArr = res.data;
            // });
        },
        /**
         * 获取测量点性质
         */
        getLineNature() {
            // http({
            //   url: "/device-boot/terminalTree/getTerminalTree",
            //   method: "get",
            //   data: {
            //     dictypeName: "性质",
            //   },
            // }).then((res) => {
            //   console.log("性质", res);
            // this.lineNatureArr = res.data;
            //  });
        },
        /**
         * 重置初始状态
         */
        reaseStatus() {
            this.nodeData = {}
            this.nodeLevel = 0
            this.pageStatus = 1
            this.projectId = 0
            this.provinceId = 0
            this.gdId = 0
            this.subId = 0
            this.devId = 0
            this.busBarId = 0
            this.lineId = 0
            this.deviceIndex = '0'
            this.busBarIndex = '0'
            this.lineIndex = '0'
            this.currentGdName = ''
        },
        /**
         * AddProjectBo的内容恢复初始状态
         */
        initAddProjectBo() {
            // this.AddProjectBO.projectParam = null;
            // this.AddProjectBO.provinceParam = null;
            // this.AddProjectBO.gdInformationParam = null;
            //this.AddProjectBO.subStationBO = null;
            this.AddProjectBO.deviceParam = null
        },
        /**AddProjectBo的Id恢复初始状态 */
        initAddProjectBoId() {
            /**项目Id */
            this.AddProjectBO.projectIndex = 0
            this.AddProjectBO.provinceIndex = 0
            this.AddProjectBO.gdIndex = 0
            this.AddProjectBO.subIndex = 0
        },
        /**
         * 去除引用
         */
        removeRefer(obj) {
            return JSON.parse(JSON.stringify(obj))
        },

        //导出台账
        exportData() {
            api.exportData().then(response => {
                if (response.type === 'application/json') {
                    const fileReader = new FileReader()
                    fileReader.onloadend = () => {
                        try {
                            const jsonData = JSON.parse(fileReader.result)
                            if (jsonData.code === 'A0000') {
                                this.$message.success('批量修改监测点评分成功')
                                this.dialogVisibleUpload = false
                                this.getList()
                            } else {
                                this.$message.error(jsonData.data)
                            }
                        } catch (err) {
                            //console.log(err)
                        }
                    }
                    fileReader.readAsText(response)
                } else {
                    const link = document.createElement('a') // 创建a标签
                    let blob = new Blob([response], { type: 'application/vnd.ms-excel;charset=UTF-8' }) // 设置文件类型
                    link.style.display = 'none'
                    link.href = URL.createObjectURL(blob) // 创建URL
                    link.setAttribute('download', '监测点台账信息.xls')
                    document.body.appendChild(link)
                    link.click()
                    document.body.removeChild(link)
                }
            })
        },

        //导入台账
        importData() { },
        //模板导出
        templateExportData() { }
    }
}
</script>

<style lang="css" scoped>
/** 左侧样式 */
.el-aside {
    height: 100%;
    padding: 10px 15px;
    overflow: hidden;
    font-family: '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
        'Fira Sans', 'Droid Sans', 'Helvetica', 'Neue', 'sans-serif';
    font-size: 16px;

    /* color: #08fcfc; */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 32px;
    /* background: #f8fbfdf3; */
    box-sizing: border-box;
}

.dept-left-btn {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 5px;
}

.dept-left-input {
    width: 100%;
    margin-top: 15px;
}

.el-input__inner {
    /* background-color: #114e7f0c;
  border-color: #0f5d9900; */
}

/** 拖拽条样式 */
#drag-dept {
    position: relative;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    background-color: #04607c2a;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

.overview_scroll::-webkit-scrollbar {
    width: 10px;
    height: 1px;
    background: rgba(6, 70, 122, 0.013);
}

#drag-dept i {
    display: inline-block;
    width: 10px;
    height: 14px;
    margin: 0 1px;
    background-color: #e9e9e9;
}

.span-ellipsis {
    display: block;
    width: 100%;
    text-overflow: ellipsis;

    /* overflow: hidden; */
    white-space: nowrap;

    /* overflow: auto;
  overflow-x: auto; */
}

.title {
    /* color: #08fcfc;  */
    font-size: 0.8rem !important;
}

#drag-dept-left {
    max-width: 40%;
    min-width: 220px;
}

.dept-left-tree {
    position: relative;
    margin-top: 15px;
    overflow-y: auto;

    /* background: #0a3647; */
    color: #f8fafa;
}

.l {
    color: #dfdfdd;
}

.el-tree {
    height: 100%;
    /* background-color: transparent; */
}

.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content,
.el-tree-node__content:hover {
    background-color: #0598bdbb;
}

.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .el-tree-node__label,
.el-tree-node__content:hover .el-tree-node__label {
    color: #11de4d;
}

/** 右侧主内容容器样式 */
.el-main {
    /* background-color: ; */
    padding: 15px;
}

.main-btn {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 15px;
}

.main-form .el-form-item__label {}

.main-form .el-input__inner {
    color: #08a4c0;
}

.main-form .el-select,
.main-form .el-date-editor {
    width: 100%;
}

.overview_scroll::-webkit-scrollbar-thumb {
    margin-right: 5px;
    background: #03c1cf0e;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 0 2px #0090b411;
}

/* 定义滚动条所在轨道的样式。有圆角和阴影以及淡色系的背景色 */
.overview_scroll::-webkit-scrollbar-track {
    background: #056e8810;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 0 2px #e6faf31c;
}

.form-item {
    width: calc(33% - 30px);
}

.flex {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.form-tag,
.form-add {
    display: flex;
    justify-content: flex-start;
    margin-top: 15px;
    margin-bottom: 10px;
}

.el-tabs__item {
    color: #04606d;
}

.el-tabs__new-tab {
    float: right;
    width: 10px;
    height: 0.3rem;
    margin: 0.3rem 0 0.1rem 0.02rem;
    font-size: 0.2rem;
    line-height: 0.29rem;
    color: #06626ead;
    text-align: center;
    cursor: pointer;
    border: 1px solid #06626ead;
    border-radius: 0.05rem;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
}

.el-input.is-disabled .el-input__inner {
    color: #313030d3;
    cursor: not-allowed;

    /* background-color: #597a800c; */
    border-color: #0e378834;
}

.el-input__inner {
    /* background-color: #1463a5; */
    border-color: #0d9ebf81;
}

.el-tree-node.is-current>.el-tree-node__content {
    background-color: rgba(13, 119, 151, 0.623) !important;
}

.el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
    border-bottom-color: #03e2f7;

    /* border-top-color: 1px solid rgb(233, 235, 236); */
}

.changeStyle {
    font-size: 40px;
    font-weight: bold;
    color: rgb(8, 213, 240);
}

.el-breadcrumb__separator[class*='icon'] {
    margin: 0 1px;
    font-weight: 400;
}
</style>
<style lang="less" scoped>
::v-deep .span-ellipsis[data-v-3df04ab9] {
    display: block;
    width: 100%;
    text-overflow: ellipsis;
    /* overflow: hidden; */
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
}

::v-deep .el-tree-node__content {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    height: 26px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

::v-deep .el-breadcrumb__inner .el-breadcrumb__inner a {
    font-weight: 600 !important;
    // color:#fff !important
}

::v-deep .demo-form-inline {
    height: 36px;
    overflow: hidden;
}

::v-deep .el-tree-node__label {
    font-size: 18px !important;
    font-weight: bold !important;
}

::v-deep .el-form-item--small.el-form-item {
    height: 56px !important;
    padding: 0 !important;
    margin-bottom: 0px !important;
}
</style>
<style lang="scss" scoped>
::v-deep.el-breadcrumb__inner {
    color: $themeColor !important;
}

::v-deep.el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
    border-bottom-color: $themeColor !important;
}
</style>
