| | |
| | | |
| | | <!--产品结构树--> |
| | | <div style="overflow:auto;margin-top: 10px;height: 400px"> |
| | | <a-tree ref="tree" checkable :checkedKeys="checkedKeys" :expandedKeys.sync="expandedKeys" |
| | | :autoExpandParent="autoExpandParent" |
| | | :treeData="treeDataSource" @check="handleTreeNodeCheck" @expand="handleTreeExpand"> |
| | | <a-tree blockNode checkable :checkedKeys="checkedKeys" :expandedKeys.sync="expandedKeys" |
| | | :autoExpandParent="autoExpandParent" @select="handleTreeNodeSelect" |
| | | :treeData="treeDataSource" @check="handleTreeNodeCheck" @expand="handleTreeNodeExpand"> |
| | | <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}"> |
| | | <span v-if="label.indexOf(searchValue) > -1">{{ label.substr(0, label.indexOf(searchValue)) }}<span |
| | | class="replaceSearch">{{ searchValue }}</span>{{ label.substr(label.indexOf(searchValue) + searchValue.length) }}</span> |
| | |
| | | * 树节点展开合并时触发 |
| | | * @param expandedKeys 展开项key |
| | | */ |
| | | handleTreeExpand(expandedKeys) { |
| | | handleTreeNodeExpand(expandedKeys) { |
| | | this.expandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | |
| | | this.checkedKeys = checkedKeys |
| | | }, |
| | | |
| | | handleTreeNodeSelect(selectedKeys, { node }) { |
| | | node.$el.childNodes[1].click() |
| | | }, |
| | | |
| | | /** |
| | | * 递归获得输入项的父级key |
| | | * @param key 子项key |