doway-coms 2.2.18 → 2.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "2.2.18",
3
+ "version": "2.2.20",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -29,6 +29,7 @@
29
29
  :dropdownMatchSelectWidth="dropdownMatchSelectWidth"
30
30
  :treeDefaultExpandAll="treeDefaultExpandAll"
31
31
  :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
32
+ :filterTreeNode="filterTreeNode"
32
33
  @change="changeData"
33
34
  size="small"
34
35
  :allowClear="allowClear"
@@ -366,6 +367,26 @@ export default {
366
367
  this.$set(this.row, this.field, node.title)
367
368
  this.$emit('selectChanged', this.row)
368
369
  },
370
+ filterTreeNode(inputValue,treeNode){
371
+ if(treeNode.data.props.dataRef.name.indexOf(inputValue)>-1){
372
+ //存在inputValue则返回true,显示该节点
373
+ return true;
374
+ }
375
+ //不存在inputValue则检查父节点是否包含inputValue
376
+ let parentId = treeNode.data.props.dataRef.parentId;
377
+ while(parentId){
378
+ let parentNode = XEUtils.findTree(this.treeData, p=>p.id===parentId)
379
+ if(parentNode){
380
+ if(parentNode.item.name.indexOf(inputValue)>-1){
381
+ return true
382
+ }
383
+ parentId = parentNode.item.parentId
384
+ }else{
385
+ break
386
+ }
387
+ }
388
+ return false
389
+ },
369
390
  changeData(value) {
370
391
  if (!value) {
371
392
  this.$set(this.row, this.linkedField, '')