<template>
    <div class="random">
        <random-check-record-option @query="handleQuery"></random-check-record-option>
        <random-check-record-table ref="table" :task_id="taskId"></random-check-record-table>
    </div>
</template>

<script>
import RandomCheckRecordOption from './component/RandomCheckRecordOption'
import RandomCheckRecordTable from './component/RandomCheckRecordTable'

export default {
    components: {
        RandomCheckRecordOption,
        RandomCheckRecordTable
    },
    created() {
        this.taskId = this.$route.query.id
    },
    mounted() {
        this.taskId = this.$route.query.id
    },
    data() {
        return {
            taskId: ''
        }
    },
    methods: {
        resetForm() {
            if (this.$refs.table) {
                this.$refs.table.resetForm()
            }
        },
        handleQuery(query) {
            if (this.$refs.table) {
                this.$refs.table.resetForm(query)
            }
        }
    }
}
</script>
