wangting
2023-06-13 c1c8ac27338c1e883a3a9260185df58e76a3d7a9
Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
@@ -150,23 +150,13 @@
    },
    nodeClick(data, node, nodeComp){
      if(!this.isMuti) {
        //不要用watch监听value值,会找不到text
        this.value = data[this.config.valueField];
        this.text = data[this.config.textField];
        this.currentNode = data;
        this.$emit("setValue", {
          field: this.referConfig.field,
          showField: this.referConfig.showField,
          value: this.value,
          text: this.text,
          rawData: [this.currentNode]
        });
        this.setValue({checkedNodes:[data]})
      }
     },
    checked:(checkedNode, checkedData)=> {
      debugger;
      /*
      * this用时始终要报错,只能先注释
    checked(checkedNode, checkedData) {
      this.setValue(checkedData)
    },
    setValue:function (checkedData){
      var value = [];
      var text = [];
      const textSep =this.config.textSep;
@@ -185,21 +175,18 @@
        text.push(tempRaw.join(textSep));
      }
      this.value = value.join(',');
      this.text = text.join(',')*/
      this.value=checkedData.checkedKeys;
      this.text = text.join(',')
      this.$emit("setValue", {
        field: this.referConfig.field,
        showField: this.referConfig.showField,
        value: this.value,
        text: this.text,
        isTreeMuti:true,
        text: this.text || '',
        isTreeMuti:this.isMuti,
        rawData: checkedData.checkedNodes
      });
    }
  },
  watch:{
  }
  watch:{}
}
</script>