From cffbff8eb7af88fb4d8f9d3f6ce77f46e97ddf39 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期五, 28 六月 2024 15:39:37 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/basicInfo/ProductModelTree.vue | 45 ++++++++++++++++++++++++++++++++------------- 1 files changed, 32 insertions(+), 13 deletions(-) diff --git a/web/src/views/modules/basicInfo/ProductModelTree.vue b/web/src/views/modules/basicInfo/ProductModelTree.vue index a2ec468..a8edb11 100644 --- a/web/src/views/modules/basicInfo/ProductModelTree.vue +++ b/web/src/views/modules/basicInfo/ProductModelTree.vue @@ -1,13 +1,13 @@ <template> - <div class="product-tree-container " :style="'height:' + tree_Hei +'px'"> + <div class="product-tree-container"> <el-input placeholder="杈撳叆鍚嶇О杩涜杩囨护" - style="width: 80%" + style="width: 60%" v-model="filterText" size="small" clearable ></el-input> - <el-button type="primary" @click="add()" style="margin-top: 10px">鏂板</el-button> + <el-button type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">鏂板</el-button> <el-divider></el-divider> <el-tree style="height: 90%;overflow: auto" @@ -30,39 +30,53 @@ 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()') + } + , 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 @@ -73,3 +87,8 @@ } } </script> +<style> + .product-tree-container { + height: 100%; + } +</style> -- Gitblit v1.9.1