fix: 解决配置接口点击确定会立即调用两次接口的bug

This commit is contained in:
奔跑的面条 2022-09-17 21:54:10 +08:00
parent 368ae13db6
commit 924a173d6b

View File

@ -96,6 +96,7 @@ import { SelectHttpType } from '../../index.d'
import { ChartDataMatchingAndShow } from '../ChartDataMatchingAndShow'
import { useTargetData } from '../../../hooks/useTargetData.hook'
import { isDev, newFunctionHandle } from '@/utils'
import debounce from 'lodash/debounce'
const { HelpOutlineIcon, FlashIcon, PulseIcon } = icon.ionicons5
const { targetData, chartEditStore } = useTargetData()
@ -123,7 +124,8 @@ const requestModelHandle = () => {
}
//
const sendHandle = async () => {
const sendHandle = debounce(
async () => {
if (!targetData.value?.request) return
loading.value = true
try {
@ -139,7 +141,10 @@ const sendHandle = async () => {
loading.value = false
window['$message'].warning('数据异常,请检查参数!')
}
}
},
2000,
{ leading: true }
)
//
const themeColor = computed(() => {