| | |
| | | |
| | | <div class="flex m-t-2rem"> |
| | | <div class="label require">区域编号:</div> |
| | | <el-select v-model="areacode" placeholder="请选择区域编号" width="28rem"> |
| | | <el-select v-model="areacode" placeholder="请选择区域编号" width="28rem" @change="handleAreaCodeChange"> |
| | | <el-option |
| | | v-for="item in areaCodes" |
| | | :key="item.id" |
| | |
| | | this.areaCodes = res.cabinetList || []; |
| | | }); |
| | | }, |
| | | handleAreaCodeChange(selectedAreaCode) { |
| | | const selectedArea = this.areaCodes.find(area => area.id === selectedAreaCode); |
| | | if (selectedArea && selectedArea.areaConfigNum !== undefined) { |
| | | this.areaConfigNum = selectedArea.areaConfigNum; |
| | | } else { |
| | | this.areaConfigNum = 500; // 使用默认值 |
| | | } |
| | | if (selectedArea && selectedArea.areaBackGroudName !== undefined && selectedArea.areaBackGroudURL !== undefined) { |
| | | // 检查返回的数据是否为空 |
| | | if (selectedArea.areaBackGroudName && selectedArea.areaBackGroudURL) { |
| | | var fileInfo2 = { |
| | | name: selectedArea.areaBackGroudName, |
| | | }; |
| | | // 创建一个新的数组并替换旧的数组 |
| | | this.fileList2 = [fileInfo2]; |
| | | console.log("this.fileList2[0]", this.fileList2[0]); |
| | | this.areaBackGroudURL = selectedArea.areaBackGroudURL; |
| | | } else { |
| | | // 如果返回的数据为空,清空 fileList2 |
| | | this.fileList2 = []; |
| | | console.log("No background info available"); |
| | | } |
| | | } else { |
| | | // 如果 selectedArea 不存在或没有背景信息,清空 fileList2 |
| | | this.fileList2 = []; |
| | | console.log("No background info available"); |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | watch: {}, |
| | |
| | | /> |
| | | </div> |
| | | <div class="flex m-t-2rem"> |
| | | <div class="label ">端口:</div> |
| | | <div class="label require">端口:</div> |
| | | <input |
| | | class="value input" |
| | | v-model="port" |
| | |
| | | }, |
| | | async submit() { |
| | | //todo 提交设备 |
| | | if (!this.isValidIP(this.ipAddress)) { |
| | | if (this.ipAddress && !this.isValidIP(this.ipAddress)) { |
| | | this.$message.warning("请输入有效的IP地址"); |
| | | return; |
| | | } |
| | | if (!this.name || !this.selectcode || !this.cabinetName || !this.networkPort) { |
| | | if (!this.name || !this.selectcode || !this.cabinetName || !this.networkPort || !this.port ) { |
| | | this.$message.warning("数据未填写完整"); |
| | | return; |
| | | } |
| | |
| | | areaCode: this.selectcode, |
| | | switchName: this.name, |
| | | |
| | | areaRow:this.cur_item?.row, |
| | | areaCell:this.cur_item?.cell, |
| | | areaRow:this.cur_item?.row?this.cur_item?.row:-1, |
| | | areaCell:this.cur_item?.cell?this.cur_item?.cell:-1, |
| | | |
| | | }, |
| | | }; |