Browse Source

新增汇率防止多次点击重复提交

Hongxilin
hongxilin 5 months ago
parent
commit
b935e72430
  1. 6
      vue/gold-system/src/views/managerecharge/rate.vue

6
vue/gold-system/src/views/managerecharge/rate.vue

@ -5,6 +5,7 @@ import axios from "axios";
import { createApp } from "vue";
import moment from "moment";
import API from "../../api/index.js";
import _ from "lodash";
//
const adminData = ref({
@ -159,7 +160,8 @@ const add = () => {
}
});
};
// 使 _.throttle trailing false
const throttledAdd = _.throttle(add, 5000, { trailing: false });
//
const rateEdit = ref({});
//
@ -663,7 +665,7 @@ function handleInput(value) {
</el-form-item>
<el-form-item>
<div class="dialog-footer">
<el-button type="primary" @click="add">添加</el-button>
<el-button type="primary" @click="throttledAdd">添加</el-button>
<el-button @click="regeAdd = false">取消</el-button>
</div>
</el-form-item>

Loading…
Cancel
Save