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 GitHub
parent 41d072bc90
commit 591a98bff1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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 = '') {