licp
2024-11-04 cf6e91b8d81b528d65257fdc4912011873977cad
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
@@ -359,12 +359,14 @@
      isMore:false,
      loading:{},
      intermodulationNum:0,//互调检验项目的数量
      upTemplateState:false,
    };
  },
  watch: {
    // 角度数量变化时,更新所有频段下面的所有项目下的所有端口和角度
    angleList(val) {
      this.allBandList.forEach(item => {
      if(!this.upTemplateState){
        this.allBandList.forEach(item => {
        item.projectList.forEach(m => {
          // 添加角度
          for(let i=0;i<val.length;i++){
@@ -401,6 +403,7 @@
          }
        })
      })
      }
      // console.log(this.allBandList)
    },
    currentNum(val) {
@@ -474,6 +477,7 @@
                    angleList.push({value:m})
                  })
                  this.angleList = angleList
                  this.upTemplateState = false;
                }
                let tell = ''
                if(item.tell.includes(',')){
@@ -574,6 +578,7 @@
    },
    // 删除数组
    deleteList(index,list,type){
      this.upTemplateState = false;
      if(list.length>1){
        if(type=='互调'){
          let index = null;
@@ -629,6 +634,7 @@
    },
    // 添加数组
    addList(list,type){
      this.upTemplateState = false;
      if(type=='互调'){
        let obj = null;
        let index = null;
@@ -790,6 +796,35 @@
      }).catch(err => {
        console.log(err)
      })
    },
    // 更新模板
    upTemplate(obj){
      this.upTemplateState = true;
      // return
      obj.allBandList.forEach((item,index)=>{
        if(!this.allBandList[index]){
          this.allBandList[index] = {
            projectList:this.HaveJson(this.allBandList[0].projectList)
          }
        }
        this.allBandList[index].band = item.band
        let arr = []
        item.projectList.forEach((m,i)=>{
          if(this.allBandList[index].projectList.find(n=>n.inspectionItemSubclass==m.inspectionItemSubclass)){
            let obj0 = {
            angleList:m.angleList,
            portList:m.portList,
            portNum:m.portNum,
              value:m.value,
              valueType:m.valueType
            }
            arr.push({...this.allBandList[index].projectList.find(n=>n.inspectionItemSubclass==m.inspectionItemSubclass),...obj0})
          }
        })
        this.allBandList[index].projectList = arr
      })
      this.angleList = obj.angleList
      this.intermodulationNum = obj.intermodulationNum
    }
  }
}