<template>
    <div class="component-survey-table">
        <Table border size='small' ref="selection" :columns="columns" :data="tableData" stripe></Table>
    </div>
</template>
<script>
    export default {
        props: {
            tableDatas: {
                type: Array,
                default:[]
            }
        },
        data(vm) {
            return {
                setScoreModal: false,
                downloadModal: false,
                mutualEvaluationModal: false,
                isSaveComment: false,
                currentUsedComment: null,
                userInfo: this.$store.state.userInfo,
                isScoreLoading: false,
                currentStudent: null,
                currentHw: null,
                currentScore: 100,
                currentComment: '',
                currentFileList: [],
                currentRateValue: 0,
                downloadList: [],
                usedCommentList: [],
                columns: [
                    {
                        title: vm.$t('survey.questionaire.name'),
                        key: 'name'
                    },
					{
					    title: vm.$t('survey.questionaire.id'),
					    key: 'id'
					},
                    {
                        title: vm.$t('survey.questionaire.className'),
                        render: (h, params) => {
                            return h('span', params.row.classroomName)
                        },
                    },
                    {
                        title: vm.$t('survey.questionaire.status'),
                        render: (h, params) => {
                            return h('span', vm.$t('survey.questionaire.unfinished'))
                        },
                    },
                    
                ],
                tableData: [],
                commentList: [],
                studentsNum:0
            }
        },
        methods: {

            /**
             * 全选操作
             * @param status
             */
            handleSelectAll(status) {
                this.$refs.selection.selectAll(status);
            },

        },


        mounted() {
            
        },
        watch: {
            tableDatas: {
                handler(newValue) {
                    /** 编辑回显 */
                    if (Array.isArray(newValue) && newValue.length) {
                        this.tableData = newValue
                    } else {
                        this.tableData = []
                    }
                },
                deep: true,
				immediate:true
            }
        }
    }
</script>

<style lang="less">
    @import "./BaseSsTable.less";
</style>