import { stemTypeList, questionNumberTypeList, scoreTypeList, switchOption } from './common'; export function handleToneValue(valItem) { let numList = []; if (/[A-Za-zü]+\d/g.test(valItem)) { valItem.split('').forEach((item, i) => { if (/\d/.test(item)) { let numIndex = numList.length === 0 ? 0 : numList[numList.length - 1].index; let con = valItem.substring(numIndex, i).replace(/\d/g, ''); numList.push({ number: item, con, }); } }); } else { numList = []; } return numList.length === 0 ? [{ con: valItem }] : numList; } // 填空题数据模板 export const fillData = { type: 'fill', // 题型 stem: '', // 题干 file_id_list: [], // 文件 id 列表 description: '', // 描述 article: '', // 文章 model_essay: [], // 文章解析后的数据 answer: { score: 1, score_type: scoreTypeList[0].value, answer_list: [] }, // 答案 // 题型属性 property: { stem_type: stemTypeList[0].value, // 题干类型 question_number: '1', // 题号 is_enable_description: switchOption[1].value, // 描述 score: 1, // 分值 score_type: scoreTypeList[0].value, // 分值类型 }, // 其他属性 other: { question_number_type: questionNumberTypeList[1].value, // 题号类型 }, };