fix: getListHeadByDataList函数里面的兼容radio-nps (#89)

This commit is contained in:
chaorenluo 2024-04-03 11:22:43 +08:00 committed by sudoooooo
parent c07fc4341d
commit a39f3ed3b1

View File

@ -31,7 +31,8 @@ export async function getSchemaBySurveyType(surveyType: string) {
export function getListHeadByDataList(dataList) {
const listHead = dataList.map((question) => {
let othersCode;
if (question.type === 'radio-star') {
const radioType = ['radio-star', 'radio-nps'];
if (radioType.includes(question.type)) {
const rangeConfigKeys = Object.keys(question.rangeConfig);
if (rangeConfigKeys.length > 0) {
othersCode = [{ code: `${question.field}_custom`, option: '填写理由' }];