perf(baTable):添加表单默认值改为深拷贝

This commit is contained in:
妙码生花 2023-05-17 15:38:40 +08:00
parent 5cf0fc9530
commit 7632ac7d8b

View File

@ -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