examQuestionBatchImport.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div class="app-container">
  3. <a-spin :spinning="loading">
  4. <div class="common-card">
  5. <a-upload
  6. name="file"
  7. accept=".pdf"
  8. :headers="headers"
  9. @change="handleChange"
  10. >
  11. <a-button> <a-icon type="upload" /> Click to Upload </a-button>
  12. </a-upload>
  13. </div>
  14. </a-spin>
  15. <div class="company-info">
  16. <span>
  17. copyright © 浮游科技有限公司出品
  18. </span>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'examQuestionBatchImport',
  25. props: {},
  26. components: {},
  27. data() {
  28. return {
  29. loading: false, // 是否显示加载动画
  30. headers: {
  31. authorization: 'authorization-text',
  32. },
  33. };
  34. },
  35. created() {
  36. this.initDataFun(); //初始化数据
  37. },
  38. mounted() {},
  39. beforeDestroy() {},
  40. watch: {},
  41. computed: {},
  42. methods: {
  43. //初始化数据
  44. initDataFun() {},
  45. handleChange(info) {
  46. if (info.file.status !== 'uploading') {
  47. console.log(info.file, info.fileList);
  48. }
  49. if (info.file.status === 'done') {
  50. this.$message.success(`${info.file.name} file uploaded successfully`);
  51. } else if (info.file.status === 'error') {
  52. this.$message.error(`${info.file.name} file upload failed.`);
  53. }
  54. },
  55. uploadFileFun(e, v, m) {
  56. console.log(e, v, m);
  57. },
  58. },
  59. };
  60. </script>
  61. <style lang="less"></style>
  62. <style lang="less" scoped>
  63. @import '~@/styles/common/variable.less';
  64. </style>