|
|
|
@ -1,8 +1,15 @@ |
|
|
|
<template> |
|
|
|
<el-tree :data="customerOrg.customerOrgTree" :props="customerOrg.treeprops" |
|
|
|
node-key="id" |
|
|
|
:default-expanded-keys="customerOrg.defaultExpandedKeys" |
|
|
|
@node-click="treeclick" highlight-current ref="customerOrgTree"/> |
|
|
|
<div> |
|
|
|
<div style="margin:2px 2px 2px 2px;"> |
|
|
|
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" /> |
|
|
|
</div> |
|
|
|
<div :style="'overflow: scroll;height:' +(window.pageHeight < 600 ? 370 : window.pageHeight - 230) + 'px;'"> |
|
|
|
<el-tree :data="customerOrg.customerOrgTree" :props="customerOrg.treeprops" |
|
|
|
node-key="id" :filter-node-method="filterNode" |
|
|
|
:default-expanded-keys="customerOrg.defaultExpandedKeys" |
|
|
|
@node-click="treeclick" highlight-current ref="customerOrgTree"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { mapState, mapMutations } from "vuex"; |
|
|
|
@ -14,7 +21,7 @@ export default { |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
|
|
|
|
filterText:'' |
|
|
|
}; |
|
|
|
}, |
|
|
|
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree> |
|
|
|
@ -127,6 +134,13 @@ export default { |
|
|
|
//联系人 |
|
|
|
this.getContactPersonList(data.id); |
|
|
|
}, |
|
|
|
|
|
|
|
//树过滤 |
|
|
|
filterNode(value, data) { |
|
|
|
//console.log(value,data) |
|
|
|
if (!value) return true; |
|
|
|
return data['displayName'].indexOf(value) !== -1; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
@ -137,7 +151,11 @@ export default { |
|
|
|
this.$refs['customerOrgTree'].setCurrentKey(newVal); |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
"filterText"(newVal,oldVal){ |
|
|
|
this.$refs['customerOrgTree'].filter(newVal); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|