From eeaed801bab7e0de82bbee438211e422246533fe Mon Sep 17 00:00:00 2001 From: xiaobai <857694115@qq.com> Date: Fri, 6 Aug 2021 18:45:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E6=B7=BB=E5=8A=A0=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E5=9B=9E=E6=98=BE=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/drawerDialog/index.vue | 41 +++++++++++---------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/src/components/drawerDialog/index.vue b/src/components/drawerDialog/index.vue index 9c1826c..d7e2587 100644 --- a/src/components/drawerDialog/index.vue +++ b/src/components/drawerDialog/index.vue @@ -832,27 +832,14 @@ export default { this.listQuery.templateId = this.id this.form.templateId = this.id this.formLabelAlign.templateId = this.id - this.getList() + if (this.id) { this.loadFormData(this.index) + this.getList() } else { + console.log(this.formTemplate, 5454242) this.$refs['formTemplate'].resetFields() - this.formTemplate = { - tempName: '', - tempCategory: '', - bglx: null, - jianyanleibie: '', - shebeizhongleidaima: '', - shebeileibiedaima: '', - tempPath: '', - jianyanyiju: '', - withDicCode: '', - parentId: '', - version: '', - sort: null, - cleanState: false, - showPageStatus: true - } + this.clearForm() } this.getSbList(undefined, undefined, 1) this.getBglxList() @@ -1165,13 +1152,11 @@ export default { this.$refs.settingList.toggleRowSelection(row) this.getDemoList(row.id) }, - beforeClose(done) { - this.list.length = 0 - this.gridData.length = 0 - this.formTemplate = Object.assign({ + clearForm() { + this.formTemplate = { tempName: '', tempCategory: '', - bglx: 1, + bglx: null, jianyanleibie: '', shebeizhongleidaima: '', shebeileibiedaima: '', @@ -1180,11 +1165,17 @@ export default { withDicCode: '', parentId: '', version: '', - sort: 0, + sort: null, cleanState: false, showPageStatus: true - }, this.formTemplate) - this.$refs['formTemplate'].resetFields() + } + this.neibuleibie = [] + this.shebeipinzhongdaima = [] + }, + beforeClose(done) { + this.list.length = 0 + this.gridData.length = 0 + this.clearForm() this.$emit('closeTemplateDrawer') } }