mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
fix:测评点击多次添加问题,限制点击频率
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
// import { useRouter } from "vue-router";
|
||||
import EvList from "./EvList.vue";
|
||||
import * as api from "../../api/indexEval";
|
||||
@@ -252,7 +252,15 @@ export default {
|
||||
console.log(err, "erererrerererererer");
|
||||
});
|
||||
}
|
||||
// 防止连续点击出现添加多条问题
|
||||
const prohibitClick = ref(false);
|
||||
const creoredit = () => {
|
||||
if(prohibitClick.value){
|
||||
message.destroy();
|
||||
message.error('请勿频繁点击')
|
||||
return
|
||||
}
|
||||
prohibitClick.value = true;
|
||||
if (props.edit) {
|
||||
editInvistText()
|
||||
} else {
|
||||
@@ -289,10 +297,12 @@ export default {
|
||||
ctx.emit("changeData", false);
|
||||
message.destroy();
|
||||
message.success("创建测评成功");
|
||||
prohibitClick.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error("创建测评失败");
|
||||
prohibitClick.value = false;
|
||||
});
|
||||
}
|
||||
//创建测评信息
|
||||
@@ -326,10 +336,12 @@ export default {
|
||||
ctx.emit("changeData", false);
|
||||
message.destroy();
|
||||
message.success("创建测评成功");
|
||||
prohibitClick.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error("创建测评失败");
|
||||
prohibitClick.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user