|  |  | 
 |  |  |             prop="switchType" | 
 |  |  |             label="switch type"> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column | 
 |  |  |             prop="areaCode" | 
 |  |  |             label="Area Code"> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column | 
 |  |  |             prop="networkPort" | 
 |  |  |             label="Network Port"> | 
 |  |  |         </el-table-column> | 
 |  |  |  | 
 |  |  |       </el-table> | 
 |  |  |  | 
 |  |  |     </el-dialog> | 
 |  |  |     <equ-add-form ref="equAddForm" :code="code" :areas="areas" :init_device_list="device_list" | 
 |  |  |                   @update="update_map"></equ-add-form> | 
 |  |  |                   @update="update_map"  @update-server-info="update_server_info" ></equ-add-form> | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  | <script> | 
 |  |  | 
 |  |  |     serve_info: {}, | 
 |  |  |     serve_select:{}, | 
 |  |  |     code:"", | 
 |  |  |     cabinetName:"", | 
 |  |  |     cabinetNameForOpen:"", | 
 |  |  |     switchName:"", | 
 |  |  |   }, | 
 |  |  |   //根据 | 
 |  |  |   //后端存储的是世界坐标,初次时候也是世界坐标,最小单位为0.01吧,这个间距或者大小,不考虑实际像素 | 
 |  |  | 
 |  |  |     console.log("serve_infoserve_infoserve_infoserve_info") | 
 |  |  |     console.log("this.serve_info:",this.serve_info) | 
 |  |  |     console.log("this.serve_select:",this.serve_select) | 
 |  |  |     //这里取打开的交换机柜的名称 | 
 |  |  |     this.cabinetNameForOpen = this.serve_info.cabinetName; | 
 |  |  |   }, | 
 |  |  |    mounted() { | 
 |  |  |      getAreaTjData().then((res) => { | 
 |  |  | 
 |  |  |       //获取一下信息 | 
 |  |  |       this.$modal.loading("加载中"); | 
 |  |  |       const res = await getDeviceList(this.code, info.cabinetName); | 
 |  |  |       this.$modal.closeLoading(); | 
 |  |  |       console.log("serveinfo", res); | 
 |  |  |       // this.activateSwitchPorts = res.switchDetialInfos || []; | 
 |  |  |       this.activateSwitchPorts = {}; | 
 |  |  |       //分两行,每行24个 | 
 |  |  |       this.switchAllDetialInfos = res.switchAllDetialInfos || [] | 
 |  |  |       console.log("switchAllDetialInfos", this.switchAllDetialInfos) | 
 |  |  |       var activaePorts = {}; | 
 |  |  |       if (res.switchDetialInfos) { | 
 |  |  |         for (var item of res.switchDetialInfos) { | 
 |  |  |           if (item.port) activaePorts[item.port] = item; | 
 |  |  |         } | 
 |  |  |       } | 
 |  |  |       console.log("activaePorts", activaePorts); | 
 |  |  |       for (var i = 0; i <= 47; i++) { | 
 |  |  |         var level = "" + parseInt(i / 24); | 
 |  |  |         if (!this.activateSwitchPorts["" + level]) { | 
 |  |  |           this.activateSwitchPorts["" + level] = []; | 
 |  |  |         } | 
 |  |  |         this.activateSwitchPorts["" + level].push({ | 
 |  |  |           index: "" + (i + 1), | 
 |  |  |           name: "", | 
 |  |  |           info: activaePorts["" + (i + 1)] || undefined, | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |       // console.log("this.activateSwitchPorts", this.activateSwitchPorts); | 
 |  |  |       this.dialog_activateSwitchPorts = true; | 
 |  |  |       this.cabinetName = info.cabinetName; | 
 |  |  |     }, | 
 |  |  |     async update_server_info(code,name) { | 
 |  |  |       // name 是交换机 | 
 |  |  |       console.log("info",code,name); | 
 |  |  |       this.$modal.loading("加载中"); | 
 |  |  |       const res = await getDeviceList(code, name); | 
 |  |  |       this.$modal.closeLoading(); | 
 |  |  |       console.log("serveinfo", res); | 
 |  |  |       // this.activateSwitchPorts = res.switchDetialInfos || []; | 
 |  |  | 
 |  |  |       } | 
 |  |  |       // console.log("this.activateSwitchPorts", this.activateSwitchPorts); | 
 |  |  |       this.dialog_activateSwitchPorts = true; | 
 |  |  |       this.cabinetName = info.cabinetName; | 
 |  |  |       this.cabinetName = cabinetName; | 
 |  |  |     }, | 
 |  |  |     click_item_add() { | 
 |  |  |       console.log("this.$refs.equAddForm", this.$refs.equAddForm); | 
 |  |  |       console.log("this.areas", this.areas); | 
 |  |  |       this.$refs.equAddForm && this.$refs.equAddForm.openConfigform(this.code,this.cabinetName); | 
 |  |  |       const queryParams = this.$route.query; | 
 |  |  |       console.log("queryParams",queryParams) | 
 |  |  |       let config = 0; | 
 |  |  |       if (queryParams.code) { | 
 |  |  |         config = 1; | 
 |  |  |       } | 
 |  |  |       this.$refs.equAddForm && this.$refs.equAddForm.openConfigform(this.code,this.cabinetName,this.cabinetNameForOpen,config); | 
 |  |  |     }, | 
 |  |  |   }, | 
 |  |  | }; |