| | |
| | | <template> |
| | | <div class="product-tree-container " :style="'height:' + tree_Hei +'px'"> |
| | | <div class="product-tree-container"> |
| | | <el-input |
| | | placeholder="输入名称进行过滤" |
| | | style="width: 60%" |
| | |
| | | |
| | | export default { |
| | | name: 'ProductModelTree', |
| | | props: {}, |
| | | props: { |
| | | showXdy: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | filterText: '', |
| | | productList: [], |
| | | tree_Hei: document.documentElement.clientHeight - 200, |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'name' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | , |
| | | watch: { |
| | | filterText(val) { |
| | | this.$refs.tree.filter(val) |
| | | } |
| | | }, |
| | | } |
| | | , |
| | | components: { |
| | | AddOrUpdate |
| | | }, |
| | | } |
| | | , |
| | | mounted() { |
| | | this.getProductList() |
| | | }, |
| | | } |
| | | , |
| | | methods: { |
| | | // 获取系统列表 |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/tree') |
| | | let params = { |
| | | showXdy:this.showXdy |
| | | } |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/tree',{params:params}) |
| | | this.productList = res.data |
| | | console.log(res.data,'async getProductList()') |
| | | }, |
| | | console.log(res.data, 'async getProductList()') |
| | | } |
| | | , |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null,{id: null, type: 'tree'}) |
| | | }, |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'tree'}) |
| | | } |
| | | , |
| | | filterNode(value, data) { |
| | | if (!value) return true |
| | | return data.name.indexOf(value) !== -1 |
| | |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .product-tree-container { |
| | | height: 100%; |
| | | } |
| | | </style> |