diff --git a/src/pages/examine/modal/index.tsx b/src/pages/examine/modal/index.tsx index a78aa1d..f7848ba 100644 --- a/src/pages/examine/modal/index.tsx +++ b/src/pages/examine/modal/index.tsx @@ -93,10 +93,12 @@ const examineModal: React.FC<{ currentUser: any }> = (props) => { let options: string = '' if (item.question.options && item.question.options.length > 0) { item.question.options.forEach((subItem: any, subIndex: number) => { - options += `${subIndex > 0 ? ',' : ''}选项${subIndex + 1}:${subItem.text}` + options += `${subItem.text};` + // ${subIndex > 0 ? ',' : ''} 选项${subIndex + 1}: }) } - questionStr += `${index > 0 ? ',' : ''}问题${index + 1}:${item.question.title},${options}` + questionStr += `${index > 0 ? ',' : ''}问题:${item.question.title}。${options}` + // ${index + 1} }) } return questionStr || '' diff --git a/src/pages/examine/record/components/recordDetail.tsx b/src/pages/examine/record/components/recordDetail.tsx index 0c8be7b..527ca35 100644 --- a/src/pages/examine/record/components/recordDetail.tsx +++ b/src/pages/examine/record/components/recordDetail.tsx @@ -65,10 +65,11 @@ const RecordDetail = ({ parentRow, show, detailType, currentUser, onRef, showErr dataIndex: "title", hideInTable: detailType === 'modal', render: (_, record) => { + let questionType: string = record?.question.type.split('_')[0] let str: string = '' if (record.choiceResponse && record?.choiceResponse.length > 0) { record.choiceResponse.forEach((item: any, index: number) => { - str += `${index > 0 ? ',' : ''}答案${index + 1}:${item}` + str += `${item.text ? item.text : item};` }) } return str || "" @@ -395,7 +396,8 @@ const RecordDetail = ({ parentRow, show, detailType, currentUser, onRef, showErr let resultStr = ''; if (record.choiceResponse && record.choiceResponse.length > 0) { record.choiceResponse.forEach((item: any, index: number) => { - resultStr += `${index > 0 ? ',' : ''}结果${index + 1}:${item}`; + resultStr += `${item.text ? item.text : item}`; + // ${index > 0 ? ',' : ''}结果${index + 1}: }); } printContent += `${resultStr || ''}`; @@ -672,7 +674,8 @@ const RecordDetail = ({ parentRow, show, detailType, currentUser, onRef, showErr let file = JSON.parse(JSON.stringify(fileList)) file.push({ uid: '', - name: `${data.data.filename}.png`, + // name: `${data.data.filename}.png`, + name: `${info.file.name}.png`, status: 'done', url: url, }) @@ -724,6 +727,7 @@ const RecordDetail = ({ parentRow, show, detailType, currentUser, onRef, showErr request={async () => { let res = detailType === 'modal' ? parentRow?.questionnaireTemplateQuestions || [] : parentRow?.questionResponses || [] + console.log('parentRow', parentRow); console.log('res', res); let obj: any = {} @@ -741,6 +745,9 @@ const RecordDetail = ({ parentRow, show, detailType, currentUser, onRef, showErr } setExamineObj(obj) + console.log('resresres', res); + + let tableData = await handeGetTableData(typeData, res) console.log('tableData', tableData); // 拿到整个数据之后 递归取出tableData中有 question 数据的那一层数据变为一个数组 @@ -749,6 +756,10 @@ const RecordDetail = ({ parentRow, show, detailType, currentUser, onRef, showErr // 处理表格数据,为合并单元格做准备 let processedData = processTableDataForMerge(tableRes); + + + console.log('processedData', processedData); + setTableData(processedData) if (processedData && processedData.length > 0) {