MS-CIAZDCOIXVRW\Administrator 3 år sedan
förälder
incheckning
c08eb9123b
5 ändrade filer med 35 tillägg och 44 borttagningar
  1. BIN
      public/favicon.ico
  2. 1 3
      src/App.vue
  3. 34 23
      src/components/Home/index.vue
  4. 0 2
      src/main.js
  5. 0 16
      src/router/index.js

BIN
public/favicon.ico


+ 1 - 3
src/App.vue

@@ -1,8 +1,6 @@
 <template>
   <div id="app">
-    <router-view>
-      <Home />
-    </router-view>
+    <Home />
   </div>
 </template>
 

+ 34 - 23
src/components/Home/index.vue

@@ -140,6 +140,8 @@ export default {
       timer: null,
       // 文件名称
       form_name: "考勤表",
+      // 文件数据
+      fileData: null,
       // 墨轩湖打卡次数
       clockIn_mo: 4,
       // 黄家湖打卡次数
@@ -150,32 +152,10 @@ export default {
     };
   },
   methods: {
-    // 点击设置按钮回调
-    handleSet() {
-      this.drawer = true;
-    },
-    // 点击开始按钮回调
-    handleStart() {
-      if (this.showPage == 2 && this.percentage == 100) {
-        this.showPage = 3;
-        this.timer = setInterval(() => {
-          this.parsePercentage += 20;
-          this.time_s += 1;
-          if (this.parsePercentage >= 100) {
-            this.parsePercentage = 100;
-            clearInterval(this.timer);
-            this.showPage = 4;
-          }
-        }, 1000);
-      } else if (this.showPage == 3) {
-        this.$message.error("解析中,请勿重复点击");
-      } else {
-        this.$message.error("请先上传文件");
-      }
-    },
     // 文件上传回调
     async handleUpload(file) {
       if (file) {
+        this.fileData = file;
         this.form_name = file.name;
         this.hasDrag = false;
         this.showPage = 2;
@@ -213,6 +193,28 @@ export default {
         return false;
       }
     },
+
+    // 点击开始按钮回调
+    handleStart() {
+      // console.log(this.fileData);
+      if (this.showPage == 2 && this.percentage == 100) {
+        this.showPage = 3;
+        this.timer = setInterval(() => {
+          this.parsePercentage += 20;
+          this.time_s += 1;
+          if (this.parsePercentage >= 100) {
+            this.parsePercentage = 100;
+            clearInterval(this.timer);
+            this.showPage = 4;
+          }
+        }, 1000);
+      } else if (this.showPage == 3) {
+        this.$message.error("解析中,请勿重复点击");
+      } else {
+        this.$message.error("请先上传文件");
+      }
+    },
+
     // 删除列表文件时的回调
     handleRemove() {
       this.hasDrag = true;
@@ -220,10 +222,12 @@ export default {
       this.info = "上传中,请稍等";
       this.percentage = 0;
     },
+
     // 预览按钮回调
     handlePreview() {
       this.dialogVisible = true;
     },
+
     // 重新开始按钮回调
     handleRestart() {
       this.hasDrag = true;
@@ -232,10 +236,17 @@ export default {
       this.percentage = 0;
       this.parsePercentage = 0;
     },
+
     // 文件超出个数限制时的钩子
     handleExceed() {
       this.$message.error("只能同时上传一个文件");
     },
+
+    // 点击设置按钮回调
+    handleSet() {
+      this.drawer = true;
+    },
+
     // 关闭弹窗回调
     handleClose() {
       this.drawer = false;

+ 0 - 2
src/main.js

@@ -1,6 +1,5 @@
 import Vue from 'vue'
 import App from './App.vue'
-import router from './router'
 import axios from 'axios'
 
 import { Upload, Button, Message, Drawer, MessageBox, Progress, Dialog } from 'element-ui';
@@ -21,6 +20,5 @@ Vue.prototype.$axios = axios;
 Vue.config.productionTip = false
 
 new Vue({
-  router,
   render: h => h(App),
 }).$mount('#app')

+ 0 - 16
src/router/index.js

@@ -1,16 +0,0 @@
-import Vue from 'vue'
-import Router from 'vue-router'
-import Home from '@/components/Home'
-
-Vue.use(Router)
-
-export default new Router({
-    routes: [{
-        path: '/',
-        name: 'Home',
-        component: Home
-    }],
-    scrollBehavior(to, from, savedPosition) {
-        return { x: 0, y: 0 }
-    },
-})