src/views/mdc/common/BaseTree.vue
@@ -112,21 +112,24 @@
      ...mapActions(['QueryProduction']),
      getCurrSelectedTitle() {
        return !this.currSelected.title ? '' : this.currSelected.title
      }
      ,
      },
      /**
       * 取消车间选中项
       */
      onClearSelected() {
        this.hiding = true
        this.currSelected = {}
        this.selectedKeys = []
        console.log('发送')
        // this.$bus.$emit('treeClearSelected','重置列表')
        this.$emit('sendSelectBaseTree', '')
      },
      onSelect(selectedKeys, e) {
        this.hiding = false
        let record = e.node.dataRef
        this.currSelected = Object.assign({}, record)
        this.selectedKeys = [record.key]
        console.log(this.selectedKeys)
        console.log('选中树中项',this.selectedKeys)
        this.$emit('sendSelectBaseTree', this.selectedKeys)
      },
      handleEdit(entity) {
@@ -167,8 +170,7 @@
        //   this.loading = false
        //   this.cardLoading = false
        // })
      }
      ,
      },
      handleChange() {
        let search = this.searchInput
        let expandedKeys = this.dataList
@@ -186,8 +188,7 @@
          searchValue: search,
          autoExpandParent: true
        })
      }
      ,
      },
      handleSearch(value) {
        let search = value
        let expandedKeys = this.dataList
@@ -206,8 +207,7 @@
          searchValue: search,
          autoExpandParent: true
        })
      }
      ,
      },
      getParentKey(key, tree) {
        let parentKey
        for (let i = 0; i < tree.length; i++) {
@@ -223,7 +223,6 @@
        }
        return parentKey
      },
      generateList(data) {
        for (let i = 0; i < data.length; i++) {
          const node = data[i]
@@ -288,9 +287,7 @@
        this.queryTreeData()
        // 新增/修改 成功时,重载列表
      }
    }
    ,
    },
    //监听
    watch: {
      currSelected(val) { //监听currSelected 变化,将变化后的数值传递给 getCurrSelected 事件