From 7632ac7d8b074b79e412340b04d4183fd84eac89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Wed, 17 May 2023 15:38:40 +0800 Subject: [PATCH] =?UTF-8?q?perf(baTable):=E6=B7=BB=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E9=BB=98=E8=AE=A4=E5=80=BC=E6=94=B9=E4=B8=BA=E6=B7=B1?= =?UTF-8?q?=E6=8B=B7=E8=B4=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/baTable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/utils/baTable.ts b/web/src/utils/baTable.ts index 45872927..fbf4f8a5 100644 --- a/web/src/utils/baTable.ts +++ b/web/src/utils/baTable.ts @@ -5,7 +5,7 @@ import Sortable from 'sortablejs' import { findIndexRow } from '/@/components/table' import { ElNotification, ElForm } from 'element-plus' import { onBeforeRouteUpdate, useRoute } from 'vue-router' -import { isUndefined } from 'lodash-es' +import { cloneDeep, isUndefined } from 'lodash-es' import { i18n } from '/@/lang/index' import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults' @@ -171,7 +171,7 @@ export default class baTable { } this.requestEdit(operateIds[0]) } else if (operate == 'add') { - this.form.items = Object.assign({}, this.form.defaultItems) + this.form.items = cloneDeep(this.form.defaultItems) } this.form.operate = operate this.form.operateIds = operateIds