fix: 修复新增同类型题目设置值不变问题 (#359)

Co-authored-by: jiangchunfu <jiangchunfu@kaike.la>
This commit is contained in:
Jiangchunfu 2024-07-23 14:17:31 +08:00 committed by sudoooooo
parent 7e5a8ae5c1
commit 8ea8869ca7

View File

@ -1,5 +1,5 @@
import { defaultQuestionConfig } from '../config/questionConfig' import { defaultQuestionConfig } from '../config/questionConfig'
import { map as _map } from 'lodash-es' import { map as _map, cloneDeep } from 'lodash-es'
import questionLoader from '@/materials/questions/questionLoader' import questionLoader from '@/materials/questions/questionLoader'
const generateQuestionField = () => { const generateQuestionField = () => {
@ -61,7 +61,7 @@ export const getQuestionByType = (type, fields) => {
} }
} }
return newQuestion return cloneDeep(newQuestion)
} }
export function filterQuestionPreviewData(data, currentEditOne = '') { export function filterQuestionPreviewData(data, currentEditOne = '') {