Skip to content

Commit 955f2d0

Browse files
committed
fix: bug fix
1 parent 4542774 commit 955f2d0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

frontend/src/views/ds/Datasource.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ const handleDefaultDatasourceChange = (item: any) => {
7777
}
7878
}
7979
80+
const changeActiveStep = (val: number) => {
81+
activeStep.value = val > 2 ? 2 : val
82+
}
83+
8084
const formatKeywords = (item: string) => {
8185
if (!defaultDatasourceKeywords.value) return item
8286
return item.replaceAll(
@@ -359,7 +363,7 @@ const back = () => {
359363
:active-type="activeType"
360364
@refresh="refresh"
361365
@close="beforeClose"
362-
@change-active-step="(val: number) => (activeStep = val)"
366+
@change-active-step="changeActiveStep"
363367
></DatasourceForm>
364368
</el-drawer>
365369
</div>

frontend/src/views/ds/DatasourceForm.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { ElMessage } from 'element-plus-secondary'
99
import type { FormInstance, FormRules } from 'element-plus-secondary'
1010
import icon_form_outlined from '@/assets/svg/icon_form_outlined.svg'
1111
import FixedSizeList from 'element-plus-secondary/es/components/virtual-list/src/components/fixed-size-list.mjs'
12+
import { debounce } from 'lodash-es'
1213
import { Plus } from '@element-plus/icons-vue'
1314
import { useCache } from '@/utils/useCache'
1415
import { haveSchema } from '@/views/ds/js/ds-type'
@@ -339,7 +340,7 @@ const check = () => {
339340
340341
onBeforeUnmount(() => (saveLoading.value = false))
341342
342-
const next = async (formEl: FormInstance | undefined) => {
343+
const next = debounce(async (formEl: FormInstance | undefined) => {
343344
if (!formEl) return
344345
await formEl.validate((valid) => {
345346
if (valid) {
@@ -369,11 +370,11 @@ const next = async (formEl: FormInstance | undefined) => {
369370
}
370371
}
371372
})
372-
}
373+
}, 300)
373374
374-
const preview = () => {
375+
const preview = debounce(() => {
375376
emit('changeActiveStep', props.activeStep - 1)
376-
}
377+
}, 200)
377378
378379
const beforeUpload = (rawFile: any) => {
379380
setFile(rawFile)

0 commit comments

Comments
 (0)