Skip to content

Commit

Permalink
Merge pull request #479 from RelaxedDong/dev
Browse files Browse the repository at this point in the history
feat: dialogConfirmDisabled 避免重复提交
  • Loading branch information
newpanjing authored Nov 7, 2023
2 parents 1f63aac + bdad0a5 commit 6e996f0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions simpleui/templates/admin/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@
</el-form>

<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="layerSubmit()" v-text="layer.confirm_button||'确定'"></el-button>
<el-button type="primary" @click="layerSubmit()" v-text="layer.confirm_button||'确定'"
:disabled="dialogConfirmDisabled" v-loading="dialogConfirmDisabled"></el-button>
<el-button @click="visible = false" v-text="layer.cancel_button||'取消'"></el-button>
</span>
</el-dialog>
Expand All @@ -210,7 +211,8 @@
params: [],
layer: {},
rules: [],
action: ''
action: '',
dialogConfirmDisabled: false
},
methods: {
layerSubmit() {
Expand Down Expand Up @@ -245,11 +247,12 @@
data.append(item.key, item.value);
}
}

this.dialogConfirmDisabled = true;
axios.post('{% get_model_ajax_url %}'+window.location.search, data).then(res => {
if (res.data.status === 'redirect') {
self.visible = false;
window.location.href = res.data.url;
this.dialogConfirmDisabled = false;
return;
}
if (res.data.status == 'success') {
Expand All @@ -261,6 +264,7 @@
message: res.data.msg,
type: res.data.status
});
this.dialogConfirmDisabled = false;
}).catch(err => self.$message.error(err));
}
}
Expand Down

0 comments on commit 6e996f0

Please sign in to comment.