This commit is contained in:
奔跑的面条 2022-09-19 20:46:37 +08:00
commit 4f4c3b543c
3 changed files with 20 additions and 24 deletions

View File

@ -10,6 +10,7 @@ import {
RequestBodyEnum RequestBodyEnum
} from '@/enums/httpEnum' } from '@/enums/httpEnum'
import { chartInitConfig } from '@/settings/designSetting' import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
// 请求基础属性 // 请求基础属性
const requestConfig: RequestConfigType = { const requestConfig: RequestConfigType = {
@ -69,7 +70,7 @@ export class PublicConfigClass implements PublicConfigType {
animations: [] animations: []
} }
// 请求 // 请求
public request = { ...requestConfig } public request = cloneDeep(requestConfig)
// 数据过滤 // 数据过滤
public filter = undefined public filter = undefined

View File

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

View File

@ -1,5 +1,5 @@
<template> <template>
<n-modal class="go-chart-data-request" v-model:show="modelShow" :mask-closable="false" @afterLeave="closeHandle"> <n-modal class="go-chart-data-request" v-model:show="modelShow" :mask-closable="false">
<n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 1000px; height: 800px"> <n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 1000px; height: 800px">
<template #header></template> <template #header></template>
<template #header-extra> </template> <template #header-extra> </template>
@ -19,7 +19,7 @@
<n-text> </n-text> <n-text> </n-text>
<n-tag type="primary" :bordered="false" style="border-radius: 5px"> {{ requestContentTypeObj[requestContentType] }} </n-tag> <n-tag type="primary" :bordered="false" style="border-radius: 5px"> {{ requestContentTypeObj[requestContentType] }} </n-tag>
</div> </div>
<n-button type="primary" @click="closeHandle">确认</n-button> <n-button type="primary" @click="closeHandle">保存 & 发送请求</n-button>
</n-space> </n-space>
</template> </template>
</n-card> </n-card>