|
@@ -0,0 +1,103 @@
|
|
|
|
+<#assign base=request.contextPath>
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="zh-cn">
|
|
|
|
+<head>
|
|
|
|
+ <#include "../layout/header.ftlh"/>
|
|
|
|
+</head>
|
|
|
|
+
|
|
|
|
+<body>
|
|
|
|
+<div id="myVue">
|
|
|
|
+ <el-container>
|
|
|
|
+ <#include "../layout/topMenu.ftlh"/>
|
|
|
|
+
|
|
|
|
+ <el-main>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="8" :offset="8">
|
|
|
|
+ <h3 style="text-align: center">批量导入考生</h3>
|
|
|
|
+
|
|
|
|
+ <el-form label-position="right" label-width="100px" :model="curForm" ref="curForm" :rules="rules">
|
|
|
|
+ <el-form-item label=" " prop="filePath">
|
|
|
|
+ <el-upload action="${base}/upload"
|
|
|
|
+ accept=".xlsx"
|
|
|
|
+ limit="1"
|
|
|
|
+ :on-success="handleSuccess"
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
+ drag>
|
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或 <em>点击上传!</em></div>
|
|
|
|
+ <div class="el-upload__tip" slot="tip">只能上传.xlsx文件!
|
|
|
|
+ <a style="color: #409EFF;cursor: pointer;" @click="downloadTemplate()">下载模板</a>
|
|
|
|
+ </div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="doSubmit" round>确 认</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-main>
|
|
|
|
+ </el-container>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ new Vue({
|
|
|
|
+ el: '#myVue',
|
|
|
|
+ data: {
|
|
|
|
+ curForm: {
|
|
|
|
+ filePath: null,
|
|
|
|
+ },
|
|
|
|
+ rules: {
|
|
|
|
+ filePath: [
|
|
|
|
+ {required: true, message: '请选择文件!', trigger: 'blur'}
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ doSubmit() {
|
|
|
|
+ this.$refs.curForm.validate((valid) => {
|
|
|
|
+ if (!valid) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let req = {
|
|
|
|
+ type: "BATCH_IMPORT_EXAM_STUDENT",
|
|
|
|
+ params: JSON.stringify(this.curForm)
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let url = "${base}/api/task/add";
|
|
|
|
+ axios.post(url, req).then((response) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "保存成功!",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ window.location.href = '${base}/admin/taskList';
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: error.response.data.message,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleSuccess(response) {
|
|
|
|
+ console.log("上传成功!", response);
|
|
|
|
+ this.curForm.filePath = response;
|
|
|
|
+ },
|
|
|
|
+ handleRemove(file) {
|
|
|
|
+ console.log("移除文件!", file);
|
|
|
|
+ this.curForm.filePath = null;
|
|
|
|
+ },
|
|
|
|
+ downloadTemplate() {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "施工中。。。",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+</html>
|