From 09b4797fb18e2971434c8cfc217f706628e0126e Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Tue, 31 Mar 2020 11:57:41 +0800
Subject: [PATCH] 问卷答题详情

---
 SunshineIns/src/view/QuestionnairAnswer/index.js |   64 ++++++++++++++++++++++++--------
 1 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/SunshineIns/src/view/QuestionnairAnswer/index.js b/SunshineIns/src/view/QuestionnairAnswer/index.js
index 8454b92..d9af57f 100644
--- a/SunshineIns/src/view/QuestionnairAnswer/index.js
+++ b/SunshineIns/src/view/QuestionnairAnswer/index.js
@@ -1,23 +1,55 @@
 import React from 'react';
+import { Table, Tag } from 'antd';
 
-const QuestionnairAnswer = ({
-  answer
-}) => {
-  console.log(answer)
+const QuestionnairAnswer = ({ answer, index }) => {
+  // console.log(answer);
+  // const columns = [
+  //   {
+  //     title: 'Name',
+  //     dataIndex: 'name',
+  //     key: 'name',
+  //     render: text => <a>{text}</a>,
+  //   },
+  //   {
+  //     title: 'Age',
+  //     dataIndex: 'age',
+  //     key: 'age',
+  //   },
+  //   {
+  //     title: 'Address',
+  //     dataIndex: 'address',
+  //     key: 'address',
+  //   },
   return (
+    // {`${index + 1}.
     <div style={{ minHeight: 60 }}>
-      <div style={{ color: '#666' }}>{`${index + 1}.${answer.type === 'input' ? answer.completionForwards : answer.title + ':'}`}</div>
-      <div style={{ paddingLeft: 12, color: '#151515' }}>{typeof answer.answer[answer.type] !== 'string' ? (
-        typeof answer.answer[answer.type].optionValue !== 'string' ? (
-          answer.answer[answer.type].optionValue.map((item, index) => {
-            return (
-              item && <span key={index} style={{ marginRight: 15 }}>{item}</span>
-            )
-          })
-        ) : answer.answer[answer.type].optionValue
-      ) : answer.answer[answer.type]}</div>
+      {answer.answer && (
+        <React.Fragment>
+          <div style={{ color: '#666' }}>
+            {index + 1}、
+            {answer.type === 'input'
+              ? answer.completionForwards
+              : answer.title + ':'}
+          </div>
+          <div style={{ paddingLeft: 12, color: '#151515' }}>
+            {typeof answer.answer[answer.type] !== 'string'
+              ? typeof answer.answer[answer.type].optionValue !== 'string'
+                ? answer.answer[answer.type].optionValue.map((item, index) => {
+                    return (
+                      item && (
+                        <span key={index} style={{ marginRight: 15 }}>
+                          {item}
+                        </span>
+                      )
+                    );
+                  })
+                : answer.answer[answer.type].optionValue
+              : answer.answer[answer.type]}
+          </div>
+        </React.Fragment>
+      )}
     </div>
   );
-}
+};
 
-export default QuestionnairAnswer;
\ No newline at end of file
+export default QuestionnairAnswer;

--
Gitblit v1.8.0