From e0da680a60e66b78e82fff61b18e0fcbf25553bd Mon Sep 17 00:00:00 2001 From: From-wh Date: Thu, 8 Jun 2023 10:44:09 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/src/pages/product/productAdd/index.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/template/admin/src/pages/product/productAdd/index.vue b/template/admin/src/pages/product/productAdd/index.vue index 232b6c790..06b2cef9c 100644 --- a/template/admin/src/pages/product/productAdd/index.vue +++ b/template/admin/src/pages/product/productAdd/index.vue @@ -2108,10 +2108,9 @@ export default { this.oneFormValidate = [data.attr]; } this.formValidate.header = []; - this.generate(0, isCopy); - if (isCopy) this.manyFormValidate = data.attrs; + this.generate(0, isCopy, data.attrs); // this.manyFormValidate = data.attrs; - this.$set(this, 'manyFormValidate', data.attrs); + // this.$set(this, 'manyFormValidate', data.attrs); this.spec_type = data.spec_type; this.formValidate.is_virtual = data.is_virtual; if (data.spec_type === 0) { @@ -2507,7 +2506,7 @@ export default { this.showIput = true; }, // 立即生成 - generate(type, isCopy) { + generate(type, isCopy, arr) { generateAttrApi( { attrs: this.attrs, @@ -2523,6 +2522,9 @@ export default { if (this.$route.params.id !== '0' && (this.$route.query.type != -1 || type) && !isCopy) { this.manyFormValidate = info.value; } + if (isCopy) { + this.manyFormValidate = arr; + } let header = info.header; if ([1, 2].includes(this.formValidate.virtual_type)) { this.columnsInstalM = header; @@ -2532,7 +2534,7 @@ export default { this.columnsInstalM = info.header; } this.checkAllGroup(this.formValidate.is_sub); - if (!this.$route.params.id && this.formValidate.spec_type === 1) { + if (!this.$route.params.id && this.formValidate.spec_type === 1 && !isCopy) { this.manyFormValidate.map((item) => { item.pic = this.formValidate.image; });