|
|
@@ -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;
|