|
@@ -57,7 +57,9 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row class="d-flex justify-content-center">
|
|
<el-row class="d-flex justify-content-center">
|
|
- <el-button type="primary" @click="submitForm">保 存</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="submitForm" :loading="loading"
|
|
|
|
+ >保 存</el-button
|
|
|
|
+ >
|
|
<el-button @click="closeDialog">取 消</el-button>
|
|
<el-button @click="closeDialog">取 消</el-button>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -144,6 +146,7 @@ export default {
|
|
prepareSeconds: [{ required: true, message: "候考时间必填" }],
|
|
prepareSeconds: [{ required: true, message: "候考时间必填" }],
|
|
openingSeconds: [{ required: true, message: "迟到时长必填" }],
|
|
openingSeconds: [{ required: true, message: "迟到时长必填" }],
|
|
},
|
|
},
|
|
|
|
+ loading: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -182,9 +185,15 @@ export default {
|
|
if (this.isEdit) {
|
|
if (this.isEdit) {
|
|
data = { ...data, id: this.activity.id };
|
|
data = { ...data, id: this.activity.id };
|
|
}
|
|
}
|
|
- await saveActivity(data);
|
|
|
|
- this.$emit("reload");
|
|
|
|
- this.closeDialog();
|
|
|
|
|
|
+ try {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ await saveActivity(data);
|
|
|
|
+ this.$emit("reload");
|
|
|
|
+ this.$notify({ title: "保存成功", type: "success" });
|
|
|
|
+ this.closeDialog();
|
|
|
|
+ } finally {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|