Jelajahi Sumber

添加按题填写单选的数据渲染

lm 2 minggu lalu
induk
melakukan
fe761f71b0

+ 41 - 33
src/components/singleSelectQuestionBatchFill/SingleSelectQuestionBatchFill.vue

@@ -35,6 +35,15 @@ interface TitleMsg {
     questionType:number
 }
 
+interface TableColumn {
+    name:string,
+    label:string,
+    width:string,
+    fixed:string,
+    align:string,
+    minWdth:string,
+    custom:boolean,
+}
 const props = defineProps({
     titleMsg:{
         type:Object as () => TitleMsg,
@@ -47,6 +56,14 @@ const props = defineProps({
     allowEdit:{
         type:Boolean,
         required:true
+    },
+    customTableColumns:{
+        type:Array<TableColumn>,
+        default:()=>[]
+    },
+    defaultTableData:{
+        type:Array,
+        default:()=>[]
     }
 })
 
@@ -55,37 +72,7 @@ const emit = defineEmits(['questionAnswerChange'])
 const isFinishEdit = defineModel('isFinishEdit')  //是否已经填写完成
 
 
-// 模拟数据
-const tableData = ref([
-    {
-        teacher:'班主任',
-        a:false,
-        b:false,
-        c:false,
-        d:false,
-    },
-    {
-        teacher:'班主任',
-        a:false,
-        b:false,
-        c:false,
-        d:false,
-    },
-    {
-        teacher:'班主任',
-        a:false,
-        b:false,
-        c:false,
-        d:false,
-    },
-    {
-        teacher:'班主任',
-        a:false,
-        b:false,
-        c:false,
-        d:false,
-    },
-])
+const tableData = ref<any[]>([])
 
 // 处选项的选中
 const HandleCheck = (row,key,val)=>{
@@ -97,8 +84,14 @@ const HandleCheck = (row,key,val)=>{
     emit('questionAnswerChange',tableData.value)
 }
 
+watch(()=>props.defaultTableData,(newVal)=>{
+    console.log('传递的表数据变化了---',newVal)
+    tableData.value = newVal
+},{immediate:true})
+
+
 watch(()=>tableData.value,(newVal)=>{
-    console.log('当前表格数据变化了')
+    console.log('当前表格数据变化了',)
     let isFinish = true
     newVal.map(row=>{
         // 选项没有被勾选
@@ -113,7 +106,22 @@ watch(()=>tableData.value,(newVal)=>{
     // 当前问卷没有全部填写完成
         isFinishEdit.value = false
     }
-},{deep:true})
+},{deep:true,immediate:true})
+
+
+watch(()=>props.customTableColumns,(newVal)=>{
+    tableColumns.value = [
+        {
+            name:'teacher',
+            label:'',
+            width:'100',
+            fixed:'',
+            align:'center',
+            minWdth:'',
+        },
+        ...newVal
+    ]
+},{immediate:true})
 
 </script>
 

+ 28 - 45
src/components/singleSelectQuestionBatchFill/table.ts

@@ -1,49 +1,32 @@
 import { ref } from "vue"
 
-export const tableColumns = ref([
-    {
-        name:'teacher',
-        label:'',
-        width:'100',
-        fixed:'',
-        align:'center',
-        minWdth:'',
-    },
+interface TableColumn {
+    name: string;
+    label: string;  
+    width:string,
+    fixed:string,
+    align:string,
+    minWdth:string,
+    custom?:boolean,
+}
 
-    {
-        name:'a',
-        label:'A.以身作则,学识渊博,深受学生爱戴',
-        width:'200',
-        fixed:'',
-        align:'left',
-        minWdth:'',
-        custom:true,
-    },
-    {
-        name:'b',
-        label:'B.自我要求严格,敢于管理学生,依法执教',
-        width:'200',
-        fixed:'',
-        align:'left',
-        minWdth:'',
-        custom:true,
-    },
-    {
-        name:'c',
-        label:'C.居高临下,懒于学生管理,处理问题缺乏教育性',
-        width:'200',
-        fixed:'',
-        align:'left',
-        minWdth:'',
-        custom:true,
-    },
-    {
-        name:'d',
-        label:'D.自我要求懒散,教风较差,常讽刺学生',
-        width:'200',
-        fixed:'',
-        align:'left',
-        minWdth:'',
-        custom:true,
-    },
+export const tableColumns = ref<TableColumn[]>([
+    // {
+    //     name:'teacher',
+    //     label:'',
+    //     width:'100',
+    //     fixed:'',
+    //     align:'center',
+    //     minWdth:'',
+    // },
+    // {
+    //     name:'a',
+    //     label:'A.以身作则,学识渊博,深受学生爱戴',
+    //     width:'200',
+    //     fixed:'',
+    //     align:'left',
+    //     minWdth:'',
+    //     custom:true,
+    // },
+   
 ])

+ 10 - 0
src/utils/numberConvertExcelColumn.ts

@@ -0,0 +1,10 @@
+
+export function getExcelColumn(index) {
+    let column = '';
+    let temp = index;
+    while (temp >= 0) {
+        column = String.fromCharCode(65 + (temp % 26)) + column;
+        temp = Math.floor(temp / 26) - 1;
+    }
+    return column;
+}

+ 445 - 375
src/views/questionnaireCommit/QuestionnaireCommit.vue

@@ -93,6 +93,8 @@
                         :titleMsg="currentEditQuestion" 
                         @questionAnswerChange="HandleQuestionAnswerChange"
                         :allowEdit="!isCurrentQuestionnaireTaskFinish"
+                        :customTableColumns="questionTableColumns"
+                        :defaultTableData="questionTableData"
                     />
                     <!-- 多选 1 -->
                     <BatchSelectQuestionBatchFill 
@@ -197,7 +199,7 @@ import { subjectToColor,fillOutStatusToColor,
         IsSubjectQuestionnaireUnFinish,IsSplitQuestionnaireFinish,IsSplitQuestionnaireUnFinish
     } from '@/components/commonDictConvert';
 import { useTimeCountDown } from '@/utils/dateTransform';
-
+import {getExcelColumn} from '@/utils/numberConvertExcelColumn'
 
 import { getEvaluationQuestionDataApi } from '@/api/questionnaireCommit'
 
@@ -255,378 +257,379 @@ const questionnaireProgress= computed(()=>{
 
 //  模拟所有教师的问卷数据(目前只有两个)
 const mockTeacherQuestionnaireData = ref([
-    {
-        "id": "661146080469061632",
-        "createdAt": "2026-07-15 09:58",
-        "schoolId": "10007",
-        "teacherId": "510448965049651259",
-        "teacherName": "李敏",
-        "assessmentTitle": "大学生消费情况调查问卷-复制",
-        "assessmentIllustrate": "您好!这次问卷只是针对中小学现状的调查,为心理教育提供依据。本调查问卷无记名,完全保密,请同学们必须如实填写,以利于调查问卷的有效性!谢谢合作!",
-        "assessmentScore": "15.00",
-        "assessmentSortCode": 104,
-        "useStatus": 0,
-        "questionCount": null,
-        "fullScore": null,
-        "questionData": [
-            {
-                "id": "663805618586464256",
-                "createdAt": "2026-07-22 18:06:32",
-                "updatedAt": "2026-07-22 18:06:32",
-                "schoolId": "10007",
-                "assessmentId": "661146080469061632",
-                "questionClass": 0,
-                "questionTitleName": "您的性别*",
-                "questionType": 0,
-                "questionAnswerType": 1,
-                "questionSortRole": 0,
-                "questionSortCode": 1,
-                "questionScore": null,
-                "evaluationType": 0,
-                "answerData": [
-                    {
-                        "id": "663805618636795904",
-                        "createdAt": "2026-07-22 18:06:32",
-                        "updatedAt": "2026-07-22 18:06:32",
-                        "schoolId": "10007",
-                        "assessmentId": "661146080469061632",
-                        "questionId": "663805618586464256",
-                        "questionClass": null,
-                        "questionSortCode": 1,
-                        "answerName": "男",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "663805618645184512",
-                        "createdAt": "2026-07-22 18:06:32",
-                        "updatedAt": "2026-07-22 18:06:32",
-                        "schoolId": "10007",
-                        "assessmentId": "661146080469061632",
-                        "questionId": "663805618586464256",
-                        "questionClass": null,
-                        "questionSortCode": 2,
-                        "answerName": "女",
-                        "answerScore": null
-                    }
-                ],
-                status:'done',
-            },
-            {
-                "id": "663805618678738944",
-                "createdAt": "2026-07-22 18:06:32",
-                "updatedAt": "2026-07-22 18:06:32",
-                "schoolId": "10007",
-                "assessmentId": "661146080469061632",
-                "questionClass": 0,
-                "questionTitleName": "每月消消消消消消消消消消消消消消消消消消消消消费多******用于哪些方面*",
-                "questionType": 1,
-                "questionAnswerType": 1,
-                "questionSortRole": 1,
-                "questionSortCode": 2,
-                "questionScore": null,
-                "evaluationType": 0,
-                "answerData": [
-                    {
-                        "id": "663805618703904768",
-                        "createdAt": "2026-07-22 18:06:32",
-                        "updatedAt": "2026-07-22 18:06:32",
-                        "schoolId": "10007",
-                        "assessmentId": "661146080469061632",
-                        "questionId": "663805618678738944",
-                        "questionClass": null,
-                        "questionSortCode": 1,
-                        "answerName": "伙食",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "663805618708099072",
-                        "createdAt": "2026-07-22 18:06:32",
-                        "updatedAt": "2026-07-22 18:06:32",
-                        "schoolId": "10007",
-                        "assessmentId": "661146080469061632",
-                        "questionId": "663805618678738944",
-                        "questionClass": null,
-                        "questionSortCode": 2,
-                        "answerName": "购置衣物",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "663805618708099073",
-                        "createdAt": "2026-07-22 18:06:32",
-                        "updatedAt": "2026-07-22 18:06:32",
-                        "schoolId": "10007",
-                        "assessmentId": "661146080469061632",
-                        "questionId": "663805618678738944",
-                        "questionClass": null,
-                        "questionSortCode": 3,
-                        "answerName": "日常交际",
-                        "answerScore": null
-                    }
-                ],
-                status:'done',
-            },
-            {
-                "id": "663805618745847808",
-                "createdAt": "2026-07-22 18:06:32",
-                "updatedAt": "2026-07-22 18:06:32",
-                "schoolId": "10007",
-                "assessmentId": "661146080469061632",
-                "questionClass": 0,
-                "questionTitleName": "你希望老师在哪里改进*",
-                "questionType": 2,
-                "questionAnswerType": 1,
-                "questionSortRole": 0,
-                "questionSortCode": 3,
-                "questionScore": null,
-                "evaluationType": 0,
-                "answerData": [],
-                status:'pending',
-            },
-            {
-                "id": "663805618766819328",
-                "createdAt": "2026-07-22 18:06:32",
-                "updatedAt": "2026-07-22 18:06:32",
-                "schoolId": "10007",
-                "assessmentId": "661146080469061632",
-                "questionClass": 1,
-                "questionTitleName": "你对本次问卷调查的感受",
-                "questionType": 5,
-                "questionAnswerType": 1,
-                "questionSortRole": 0,
-                "questionSortCode": 4,
-                "questionScore": "10.00",
-                "evaluationType": 0,
-                "answerData": [],
-                status:'unfinish',
-            },
-            {
-                "id": "663805618787790848",
-                "createdAt": "2026-07-22 18:06:32",
-                "updatedAt": "2026-07-22 18:06:32",
-                "schoolId": "10007",
-                "assessmentId": "661146080469061632",
-                "questionClass": 1,
-                "questionTitleName": "你对本次问卷调查的感受",
-                "questionType": 5,
-                "questionAnswerType": 1,
-                "questionSortRole": 0,
-                "questionSortCode": 5,
-                "questionScore": "5.00",
-                "evaluationType": 1,
-                "answerData": [],
-                status:'unfinish',
-            }
-        ]
-    },
-    {
-        "id": "661148998005952512",
-        "createdAt": "2026-07-15 10:10",
-        "schoolId": "10007",
-        "teacherId": "510448965049651259",
-        "teacherName": "李敏",
-        "assessmentTitle": "必填项传参测试",
-        "assessmentIllustrate": "必填项传参测试",
-        "assessmentScore": "0.00",
-        "assessmentSortCode": 101,
-        "useStatus": 1,
-        "questionCount": null,
-        "fullScore": null,
-        "questionData": [
-            {
-                "id": "661213148149264384",
-                "createdAt": "2026-07-15 14:24:59",
-                "updatedAt": "2026-07-15 14:24:59",
-                "schoolId": "10007",
-                "assessmentId": "661148998005952512",
-                "questionClass": 0,
-                "questionTitleName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
-                "questionType": 1,
-                "questionAnswerType": 1,
-                "questionSortRole": 1,
-                "questionSortCode": 1,
-                "questionScore": null,
-                "evaluationType": 0,
-                "answerData": [
-                    {
-                        "id": "661213148170235904",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148149264384",
-                        "questionClass": null,
-                        "questionSortCode": 1,
-                        "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148174430208",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148149264384",
-                        "questionClass": null,
-                        "questionSortCode": 2,
-                        "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148178624512",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148149264384",
-                        "questionClass": null,
-                        "questionSortCode": 3,
-                        "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148182818816",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148149264384",
-                        "questionClass": null,
-                        "questionSortCode": 4,
-                        "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
-                        "answerScore": null
-                    }
-                ]
-            },
-            {
-                "id": "661213148224761856",
-                "createdAt": "2026-07-15 14:24:59",
-                "updatedAt": "2026-07-15 14:24:59",
-                "schoolId": "10007",
-                "assessmentId": "661148998005952512",
-                "questionClass": 0,
-                "questionTitleName": "必填项测试1",
-                "questionType": 0,
-                "questionAnswerType": 1,
-                "questionSortRole": 1,
-                "questionSortCode": 2,
-                "questionScore": null,
-                "evaluationType": 0,
-                "answerData": [
-                    {
-                        "id": "661213148249927680",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148224761856",
-                        "questionClass": null,
-                        "questionSortCode": 1,
-                        "answerName": "选项1",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148254121984",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148224761856",
-                        "questionClass": null,
-                        "questionSortCode": 2,
-                        "answerName": "选项2",
-                        "answerScore": null
-                    }
-                ]
-            },
-            {
-                "id": "661213148283482112",
-                "createdAt": "2026-07-15 14:24:59",
-                "updatedAt": "2026-07-15 14:24:59",
-                "schoolId": "10007",
-                "assessmentId": "661148998005952512",
-                "questionClass": 0,
-                "questionTitleName": "选项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出测试",
-                "questionType": 0,
-                "questionAnswerType": 1,
-                "questionSortRole": 0,
-                "questionSortCode": 3,
-                "questionScore": null,
-                "evaluationType": 0,
-                "answerData": [
-                    {
-                        "id": "661213148308647936",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148283482112",
-                        "questionClass": null,
-                        "questionSortCode": 1,
-                        "answerName": "选项溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出测试",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148312842240",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148283482112",
-                        "questionClass": null,
-                        "questionSortCode": 2,
-                        "answerName": "选项溢出测试选项溢出测试选项溢溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试出测试选项溢出测试选项溢出测试",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148312842241",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148283482112",
-                        "questionClass": null,
-                        "questionSortCode": 3,
-                        "answerName": "选项溢出测试选项溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试选项溢出测试选项溢出测试",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148317036544",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148283482112",
-                        "questionClass": null,
-                        "questionSortCode": 4,
-                        "answerName": "4354",
-                        "answerScore": null
-                    },
-                    {
-                        "id": "661213148321230848",
-                        "createdAt": "2026-07-15 14:24:59",
-                        "updatedAt": "2026-07-15 14:24:59",
-                        "schoolId": "10007",
-                        "assessmentId": "661148998005952512",
-                        "questionId": "661213148283482112",
-                        "questionClass": null,
-                        "questionSortCode": 5,
-                        "answerName": "789",
-                        "answerScore": null
-                    }
-                ]
-            }
-        ]
-    },
+    // {
+    //     "id": "661146080469061632",
+    //     "createdAt": "2026-07-15 09:58",
+    //     "schoolId": "10007",
+    //     "teacherId": "510448965049651259",
+    //     "teacherName": "李敏",
+    //     "assessmentTitle": "大学生消费情况调查问卷-复制",
+    //     "assessmentIllustrate": "您好!这次问卷只是针对中小学现状的调查,为心理教育提供依据。本调查问卷无记名,完全保密,请同学们必须如实填写,以利于调查问卷的有效性!谢谢合作!",
+    //     "assessmentScore": "15.00",
+    //     "assessmentSortCode": 104,
+    //     "useStatus": 0,
+    //     "questionCount": null,
+    //     "fullScore": null,
+    //     "questionData": [
+    //         {
+    //             "id": "663805618586464256",
+    //             "createdAt": "2026-07-22 18:06:32",
+    //             "updatedAt": "2026-07-22 18:06:32",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661146080469061632",
+    //             "questionClass": 0,
+    //             "questionTitleName": "您的性别*",
+    //             "questionType": 0,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 0,
+    //             "questionSortCode": 1,
+    //             "questionScore": null,
+    //             "evaluationType": 0,
+    //             "answerData": [
+    //                 {
+    //                     "id": "663805618636795904",
+    //                     "createdAt": "2026-07-22 18:06:32",
+    //                     "updatedAt": "2026-07-22 18:06:32",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661146080469061632",
+    //                     "questionId": "663805618586464256",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 1,
+    //                     "answerName": "男",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "663805618645184512",
+    //                     "createdAt": "2026-07-22 18:06:32",
+    //                     "updatedAt": "2026-07-22 18:06:32",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661146080469061632",
+    //                     "questionId": "663805618586464256",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 2,
+    //                     "answerName": "女",
+    //                     "answerScore": null
+    //                 }
+    //             ],
+    //             status:'done',
+    //         },
+    //         {
+    //             "id": "663805618678738944",
+    //             "createdAt": "2026-07-22 18:06:32",
+    //             "updatedAt": "2026-07-22 18:06:32",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661146080469061632",
+    //             "questionClass": 0,
+    //             "questionTitleName": "每月消消消消消消消消消消消消消消消消消消消消消费多******用于哪些方面*",
+    //             "questionType": 1,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 1,
+    //             "questionSortCode": 2,
+    //             "questionScore": null,
+    //             "evaluationType": 0,
+    //             "answerData": [
+    //                 {
+    //                     "id": "663805618703904768",
+    //                     "createdAt": "2026-07-22 18:06:32",
+    //                     "updatedAt": "2026-07-22 18:06:32",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661146080469061632",
+    //                     "questionId": "663805618678738944",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 1,
+    //                     "answerName": "伙食",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "663805618708099072",
+    //                     "createdAt": "2026-07-22 18:06:32",
+    //                     "updatedAt": "2026-07-22 18:06:32",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661146080469061632",
+    //                     "questionId": "663805618678738944",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 2,
+    //                     "answerName": "购置衣物",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "663805618708099073",
+    //                     "createdAt": "2026-07-22 18:06:32",
+    //                     "updatedAt": "2026-07-22 18:06:32",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661146080469061632",
+    //                     "questionId": "663805618678738944",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 3,
+    //                     "answerName": "日常交际",
+    //                     "answerScore": null
+    //                 }
+    //             ],
+    //             status:'done',
+    //         },
+    //         {
+    //             "id": "663805618745847808",
+    //             "createdAt": "2026-07-22 18:06:32",
+    //             "updatedAt": "2026-07-22 18:06:32",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661146080469061632",
+    //             "questionClass": 0,
+    //             "questionTitleName": "你希望老师在哪里改进*",
+    //             "questionType": 2,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 0,
+    //             "questionSortCode": 3,
+    //             "questionScore": null,
+    //             "evaluationType": 0,
+    //             "answerData": [],
+    //             status:'pending',
+    //         },
+    //         {
+    //             "id": "663805618766819328",
+    //             "createdAt": "2026-07-22 18:06:32",
+    //             "updatedAt": "2026-07-22 18:06:32",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661146080469061632",
+    //             "questionClass": 1,
+    //             "questionTitleName": "你对本次问卷调查的感受",
+    //             "questionType": 5,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 0,
+    //             "questionSortCode": 4,
+    //             "questionScore": "10.00",
+    //             "evaluationType": 0,
+    //             "answerData": [],
+    //             status:'unfinish',
+    //         },
+    //         {
+    //             "id": "663805618787790848",
+    //             "createdAt": "2026-07-22 18:06:32",
+    //             "updatedAt": "2026-07-22 18:06:32",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661146080469061632",
+    //             "questionClass": 1,
+    //             "questionTitleName": "你对本次问卷调查的感受",
+    //             "questionType": 5,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 0,
+    //             "questionSortCode": 5,
+    //             "questionScore": "5.00",
+    //             "evaluationType": 1,
+    //             "answerData": [],
+    //             status:'unfinish',
+    //         }
+    //     ]
+    // },
+    // {
+    //     "id": "661148998005952512",
+    //     "createdAt": "2026-07-15 10:10",
+    //     "schoolId": "10007",
+    //     "teacherId": "510448965049651259",
+    //     "teacherName": "李敏",
+    //     "assessmentTitle": "必填项传参测试",
+    //     "assessmentIllustrate": "必填项传参测试",
+    //     "assessmentScore": "0.00",
+    //     "assessmentSortCode": 101,
+    //     "useStatus": 1,
+    //     "questionCount": null,
+    //     "fullScore": null,
+    //     "questionData": [
+    //         {
+    //             "id": "661213148149264384",
+    //             "createdAt": "2026-07-15 14:24:59",
+    //             "updatedAt": "2026-07-15 14:24:59",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661148998005952512",
+    //             "questionClass": 0,
+    //             "questionTitleName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
+    //             "questionType": 1,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 1,
+    //             "questionSortCode": 1,
+    //             "questionScore": null,
+    //             "evaluationType": 0,
+    //             "answerData": [
+    //                 {
+    //                     "id": "661213148170235904",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148149264384",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 1,
+    //                     "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148174430208",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148149264384",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 2,
+    //                     "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148178624512",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148149264384",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 3,
+    //                     "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148182818816",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148149264384",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 4,
+    //                     "answerName": "项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出",
+    //                     "answerScore": null
+    //                 }
+    //             ]
+    //         },
+    //         {
+    //             "id": "661213148224761856",
+    //             "createdAt": "2026-07-15 14:24:59",
+    //             "updatedAt": "2026-07-15 14:24:59",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661148998005952512",
+    //             "questionClass": 0,
+    //             "questionTitleName": "必填项测试1",
+    //             "questionType": 0,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 1,
+    //             "questionSortCode": 2,
+    //             "questionScore": null,
+    //             "evaluationType": 0,
+    //             "answerData": [
+    //                 {
+    //                     "id": "661213148249927680",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148224761856",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 1,
+    //                     "answerName": "选项1",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148254121984",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148224761856",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 2,
+    //                     "answerName": "选项2",
+    //                     "answerScore": null
+    //                 }
+    //             ]
+    //         },
+    //         {
+    //             "id": "661213148283482112",
+    //             "createdAt": "2026-07-15 14:24:59",
+    //             "updatedAt": "2026-07-15 14:24:59",
+    //             "schoolId": "10007",
+    //             "assessmentId": "661148998005952512",
+    //             "questionClass": 0,
+    //             "questionTitleName": "选项溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出测试",
+    //             "questionType": 0,
+    //             "questionAnswerType": 1,
+    //             "questionSortRole": 0,
+    //             "questionSortCode": 3,
+    //             "questionScore": null,
+    //             "evaluationType": 0,
+    //             "answerData": [
+    //                 {
+    //                     "id": "661213148308647936",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148283482112",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 1,
+    //                     "answerName": "选项溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试选项溢出测试选项溢出测试选项溢出测试",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148312842240",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148283482112",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 2,
+    //                     "answerName": "选项溢出测试选项溢出测试选项溢溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试出测试选项溢出测试选项溢出测试",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148312842241",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148283482112",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 3,
+    //                     "answerName": "选项溢出测试选项溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试溢出测试选项溢出测试选项溢出测试选项溢出测试",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148317036544",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148283482112",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 4,
+    //                     "answerName": "4354",
+    //                     "answerScore": null
+    //                 },
+    //                 {
+    //                     "id": "661213148321230848",
+    //                     "createdAt": "2026-07-15 14:24:59",
+    //                     "updatedAt": "2026-07-15 14:24:59",
+    //                     "schoolId": "10007",
+    //                     "assessmentId": "661148998005952512",
+    //                     "questionId": "661213148283482112",
+    //                     "questionClass": null,
+    //                     "questionSortCode": 5,
+    //                     "answerName": "789",
+    //                     "answerScore": null
+    //                 }
+    //             ]
+    //         }
+    //     ]
+    // },
 ])
 
 // 模拟问卷响应数据
-const mockResData = computed(()=>mockTeacherQuestionnaireData.value[currentActiveTeacherIndex.value])
+const mockResData = computed(()=>mockTeacherQuestionnaireData.value?.[currentActiveTeacherIndex.value])
 
 // 最终渲染的整体问卷数据
 const questionaireMsg = computed(()=>{
-    let addedQuestionList = mockResData.value.questionData.map(item=>{
+    let addedQuestionList = mockResData.value?.questionData?.map(item=>{
         let options = item.answerData.map(opt=>{
             return{
+                answerCode: opt.answerCode,
                 content: opt.answerName,
                 score: opt.answerScore,
                 id: opt.answerId
@@ -648,12 +651,12 @@ const questionaireMsg = computed(()=>{
         }
     })
     return{
-        assessmentTitle:mockResData.value.assessmentName,  //问卷标题
-        assessmentIllustrate:mockResData.value.assessmentIllustrate,  //问卷简介
+        assessmentTitle:mockResData.value?.assessmentName,  //问卷标题
+        assessmentIllustrate:mockResData.value?.assessmentIllustrate,  //问卷简介
         // 问卷试题列表
         questionData:addedQuestionList,
-        progress:mockResData.value.progress,
-        deadlineTime:mockResData.value.endDateTime,
+        progress:mockResData.value?.progress,
+        deadlineTime:mockResData.value?.endDateTime,
     }
 })
 
@@ -720,18 +723,85 @@ const HandleFinishReview = ()=>{
 /**
  *  4. 按题填写相关变量 和操作
  */
-// 当前试题是否已经编辑完成
-const isQuestionEdit = ref(false)
-// 当前选中的试题索引
-const currentSelectedQuestionIndex = ref(0)
+const isQuestionEdit = ref(false)  // 当前试题是否已经编辑完成
+const currentSelectedQuestionIndex = ref(0)  // 当前选中的试题索引
 
 // 当前问卷题目的 教师评价答案列表
 const singleQuestionAnswer = ref([])
 
 // 当前编辑的试题
 const currentEditQuestion = computed(()=>{
-    return questionaireMsg.value.questionData[currentSelectedQuestionIndex.value]
+    return questionaireMsg.value?.questionData?.[currentSelectedQuestionIndex.value]
 })
+
+
+// 按题填写的表格数据渲染 _ 不同题目类型渲染不同的内容
+const questionTableColumns = ref<any[]>([])  //按题填写的表列数据
+const questionTableData = ref<any[]>([])   //按题填写的表行数据
+
+
+watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
+    console.log('teacherList',teacherList.value)
+    console.log('questionaireMsg',questionaireMsg.value)
+    switch(newVal){
+        case 0:{    //单选
+            let rowKeys = { }
+
+            // 带答案的数据渲染 处理 ————
+                // 待完善
+                // —— 针对原始数据
+                // 行循环 
+                // 列循环
+
+                // 20 人答卷
+                // 同一题目 
+                // 每份答卷的同一题
+                        // 不同选项 
+                    // 每个人答案
+
+
+            // 列循环
+            // 表列(头)获取
+            questionTableColumns.value =  currentEditQuestion.value?.options?.map((item,index)=>{
+                rowKeys[item.id] = ''
+                return {
+                    name:item.id,
+                    label:`${getExcelColumn(index)}. `+item.content,
+                    width:'200',
+                    fixed:'',
+                    align:'left',
+                    minWdth:'',
+                    custom:true,
+                }
+            }) || []
+
+            questionTableData.value =  teacherList.value.map(item=>{
+                return {
+                    teacher:item.teacherName,
+                    ...rowKeys  //答案需要循环遍历
+                }
+            })
+
+            console.log('准备渲染的表数据___',questionTableData.value)
+        }    
+        case 1:{
+            //多选
+            break
+        }    
+        case 5:{
+            //评分题
+            break
+        }    
+        case 2:{
+            //问答题 
+            break
+        }   
+    }
+
+
+},{immediate:true})
+
+
 // 切换当前选中的试题索引
 const HandleChangeQuestion = (index,question)=>{
     console.log('当前索引--',index)
@@ -775,7 +845,7 @@ onMounted( async ()=>{
         }
 
     }
-    HandleTimeDeadline()
+    // HandleTimeDeadline()
 })
 
 </script>