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

This commit is contained in:
chaorenluo 2024-04-03 11:22:43 +08:00 committed by GitHub
parent a6e88fa444
commit b7a716778a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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