| | |
| | | ...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) { |
| | |
| | | // this.loading = false |
| | | // this.cardLoading = false |
| | | // }) |
| | | } |
| | | , |
| | | }, |
| | | handleChange() { |
| | | let search = this.searchInput |
| | | let expandedKeys = this.dataList |
| | |
| | | searchValue: search, |
| | | autoExpandParent: true |
| | | }) |
| | | } |
| | | , |
| | | }, |
| | | handleSearch(value) { |
| | | let search = value |
| | | let expandedKeys = this.dataList |
| | |
| | | searchValue: search, |
| | | autoExpandParent: true |
| | | }) |
| | | } |
| | | , |
| | | }, |
| | | getParentKey(key, tree) { |
| | | let parentKey |
| | | for (let i = 0; i < tree.length; i++) { |
| | |
| | | } |
| | | return parentKey |
| | | }, |
| | | |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | const node = data[i] |
| | |
| | | this.queryTreeData() |
| | | // 新增/修改 成功时,重载列表 |
| | | } |
| | | |
| | | } |
| | | , |
| | | }, |
| | | //监听 |
| | | watch: { |
| | | currSelected(val) { //监听currSelected 变化,将变化后的数值传递给 getCurrSelected 事件 |