@extends('admin::frame')

@section('pageTitle','导入题目')

@section('adminScript')
    @parent
    <link rel="stylesheet" href="@assets('assets/vue/element-ui/index.css')">
    <script src="@assets('assets/vue/element-ui/index.js')"></script>
@endsection

@section('bodyAppend')
    @parent
    <script>
        window.__tiku_data = {
            tagMapUrl: '{{action('\App\Http\Controllers\Admin\QuestionTagController@map')}}',
            questionAddUrl: '{{action('\App\Http\Controllers\Admin\QuestionController@dataAdd')}}',
            questionType: {
                '单选题': {!! json_encode(\App\Types\QuestionType::SINGLE_CHOICE) !!},
                '多选题': {!! json_encode(\App\Types\QuestionType::MULTI_CHOICES) !!},
                '判断题': {!! json_encode(\App\Types\QuestionType::TRUE_FALSE) !!},
            }
        }
    </script>
    <script src="@assets('assets/main/admin/questionImport.js')"></script>
@endsection

@section('bodyContent')

    <div id="app" v-cloak class="block admin-form">
        <div class="head">
            导入题目
        </div>
        <div class="body">
            <el-form>
                <el-form-item>
                    <el-upload action="" ref="upload" :auto-upload="false" :on-change="doFileSelect">
                        <el-button size="small">点击上传xlsx文件</el-button>
                        <div slot="tip" class="el-upload__tip">
                            只能上传xlsx文件，点击这里 <a href="javascript:;" @click="doDownloadTemplate()">下载模板文件</a>
                        </div>
                    </el-upload>
                </el-form-item>
            </el-form>
        </div>
    </div>

@endsection