Avue子表单,添加的时候,如何获取index

441 阅读1分钟

最近在在使用avue开发功能的时候,用到了子表单的,但是子表单内部需要用到弹窗回传,回传的时候,需要定位到确定行和列的位置,这里就给大家说一下,我是如何解决的

image.png

这里选择组长是点击组长文本框,弹出一个结构树,选择人员

image.png

子表单实现点击文本框弹窗,这里需要自定义子表单

image.png

image.png

然后就是获取到index值

openIndexs(row){
  this.indexs=row.$index;
  this.nodenames=""
  this.groupUserVisibles=true;
},

回传定位值

//选择组长
  gettree(){
  const s= this.$refs.trees.getCheckedKeys()
  const heads= s.join(",");
  let groupslist = this.form.groupslist;
  groupslist[this.index].groupheader = this.nodename
  groupslist[this.index].groupheaderid = this.nodeid
  this.groupUserVisible = false
}

效果图

image.png