File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff 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+
8084const 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 >
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { ElMessage } from 'element-plus-secondary'
99import type { FormInstance , FormRules } from ' element-plus-secondary'
1010import icon_form_outlined from ' @/assets/svg/icon_form_outlined.svg'
1111import FixedSizeList from ' element-plus-secondary/es/components/virtual-list/src/components/fixed-size-list.mjs'
12+ import { debounce } from ' lodash-es'
1213import { Plus } from ' @element-plus/icons-vue'
1314import { useCache } from ' @/utils/useCache'
1415import { haveSchema } from ' @/views/ds/js/ds-type'
@@ -339,7 +340,7 @@ const check = () => {
339340
340341onBeforeUnmount (() => (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
378379const beforeUpload = (rawFile : any ) => {
379380 setFile (rawFile )
You can’t perform that action at this time.
0 commit comments