From 130dc881dd22865e27bbcc378387bc767c0f41df Mon Sep 17 00:00:00 2001 From: BoBoooooo <17746714@qq.com> Date: Thu, 14 Feb 2019 18:13:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5asyncCondition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CrudTable/index.vue | 15 +++++++++++++-- src/views/system/dict.vue | 13 +++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/components/CrudTable/index.vue b/src/components/CrudTable/index.vue index ca86103..af3301b 100644 --- a/src/components/CrudTable/index.vue +++ b/src/components/CrudTable/index.vue @@ -88,8 +88,8 @@ export default { default: 'add,clear,search', }, asyncCondition: { - type: String, - default: '', + type: Object, + default: () => ({}), }, }, data() { @@ -121,7 +121,18 @@ export default { id: '', }; }, + watch: { + asyncCondition: { + deep: true, + handler(val) { + console.log(val) + this.listQuery.searchArr[0].SearchKey = val.searchKey + this.listQuery.searchArr[0].SearchValue = val.searchValue + this.fetchData(this.listQuery); + }, + }, + }, created() { this.fetchData(this.listQuery); this.getObj(); diff --git a/src/views/system/dict.vue b/src/views/system/dict.vue index 215000c..a237990 100644 --- a/src/views/system/dict.vue +++ b/src/views/system/dict.vue @@ -11,6 +11,7 @@ node-key="id" highlight-current :default-expanded-keys="['00000000-0000-0000-0000-000000000001']" + @node-click="treeClick" > {{ node.label }} @@ -38,7 +39,7 @@ - + @@ -108,6 +109,10 @@ export default { sort: '', pid: '', }, + asyncCondition: { + searchKey: '', + searchValue: '', + }, dialogStatus: '', defaultProps: { children: 'children', @@ -157,7 +162,11 @@ export default { }); }, - + treeClick(data) { + console.log(data) + this.asyncCondition.searchKey = 'dictid' + this.asyncCondition.searchValue = data.id + }, Edit(id) { GetDictTypeDetail(id).then((response) => { this.entity = response.data;