From 141ab2c334e1a7554006eda48b251b44a86c5732 Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 28 Jan 2021 15:54:39 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=92=8C=E6=9C=BA=E6=9E=84=E6=A8=A1=E5=9D=97=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E5=86=8D=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=95=8C=E9=9D=A2=E6=95=B0=E6=8D=AE=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=B8=85=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/dept.vue | 25 +++++++++---------------- src/views/system/menu.vue | 25 +++++++++---------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue index a4b9a24..c62272e 100644 --- a/src/views/system/dept.vue +++ b/src/views/system/dept.vue @@ -132,6 +132,7 @@ dicData: [], type: "tree", hide: true, + addDisabled: false, props: { label: "title" }, @@ -212,13 +213,10 @@ }); }, handleAdd(row) { - this.$refs.crud.value.parentId = row.id; - this.$refs.crud.option.column.filter(item => { - if (item.prop === "parentId") { - item.value = row.id; - item.addDisabled = true; - } - }); + this.parentId = row.id; + const column = this.findObject(this.option.column, "parentId"); + column.value = row.id; + column.addDisabled = true; this.$refs.crud.rowAdd(); }, rowSave(row, done, loading) { @@ -328,15 +326,10 @@ done(); }, beforeClose(done) { - this.$refs.crud.tableForm = {}; - this.$refs.crud.value.parentId = ""; - this.$refs.crud.value.addDisabled = false; - this.$refs.crud.option.column.filter(item => { - if (item.prop === "parentId") { - item.value = ""; - item.addDisabled = false; - } - }); + this.parentId = ""; + const column = this.findObject(this.option.column, "parentId"); + column.value = ""; + column.addDisabled = false; done(); }, currentChange(currentPage) { diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue index c72cd97..8afdb50 100644 --- a/src/views/system/menu.vue +++ b/src/views/system/menu.vue @@ -112,6 +112,7 @@ type: "tree", dicData: [], hide: true, + addDisabled: false, props: { label: "title" }, @@ -274,13 +275,10 @@ }); }, handleAdd(row) { - this.$refs.crud.value.parentId = row.id; - this.$refs.crud.option.column.filter(item => { - if (item.prop === "parentId") { - item.value = row.id; - item.addDisabled = true; - } - }); + this.parentId = row.id; + const column = this.findObject(this.option.column, "parentId"); + column.value = row.id; + column.addDisabled = true; this.$refs.crud.rowAdd(); }, rowSave(row, done, loading) { @@ -388,15 +386,10 @@ done(); }, beforeClose(done) { - this.$refs.crud.tableForm = {}; - this.$refs.crud.value.parentId = ""; - this.$refs.crud.value.addDisabled = false; - this.$refs.crud.option.column.filter(item => { - if (item.prop === "parentId") { - item.value = ""; - item.addDisabled = false; - } - }); + this.parentId = ""; + const column = this.findObject(this.option.column, "parentId"); + column.value = ""; + column.addDisabled = false; done(); }, currentChange(currentPage) {