无人机管理后台前端(已迁走)
rain
2025-04-17 0d86514fe16e5e2e50baa4abac14efc51af0328d
处理重复提交
1 files modified
11 ■■■■■ changed files
src/views/tickets/ticket.vue 11 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -446,6 +446,7 @@
  name: "TicketPage",
  data() {
    return {
      submitLoading: false, // 新增loading状态
      activeTab: "all",
      // tabs 只保留静态结构,不做权限判断
      tabs: [
@@ -965,6 +966,8 @@
    },
    async submitForm() {
      if (this.submitLoading) return; // 防止重复提交
      this.submitLoading = true;
      try {
        // 提交时需要完整验证
        await this.$refs.form.validate();
@@ -1021,9 +1024,14 @@
          this.$message.error(error.message || '工单创建失败,请稍后重试');
        }
      }
      finally {
      this.submitLoading = false;
    }
    },
    async saveDraft() {
      if (this.submitLoading) return; // 防止重复提交
      this.submitLoading = true;
      try {
        const submitData = {
          id: this.form.id,
@@ -1067,6 +1075,9 @@
      } catch (error) {
        this.$message.error(error.message || '保存草稿失败,请稍后重试');
      }
      finally {
      this.submitLoading = false;
    }
    },
    async handleLocationChange(val) {