feat(模块): 添加了个很棒的功能
This commit is contained in:
parent
a96e829ac4
commit
f4d966168e
@ -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 || ''
|
||||
|
||||
@ -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 += `<td style="text-align:left">${resultStr || ''}</td>`;
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user