File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed
Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ const emits = defineEmits([
3535 ' dataTableDetail' ,
3636 ' showTable' ,
3737 ' recommendation' ,
38+ ' startChecking' ,
39+ ' endChecking' ,
3840])
3941const icon = computed (() => {
4042 return (dsTypeWithImg .find ((ele ) => props .type === ele .type ) || {}).img
@@ -53,11 +55,17 @@ const handleDel = () => {
5355
5456const handleQuestion = () => {
5557 // check first
56- datasourceApi .check_by_id (props .id ).then ((res : any ) => {
57- if (res ) {
58- emits (' question' , props .id )
59- }
60- })
58+ emits (' startChecking' )
59+ datasourceApi
60+ .check_by_id (props .id )
61+ .then ((res : any ) => {
62+ if (res ) {
63+ emits (' question' , props .id )
64+ }
65+ })
66+ .finally (() => {
67+ emits (' endChecking' )
68+ })
6169}
6270
6371function runSQL() {
Original file line number Diff line number Diff line change @@ -198,14 +198,23 @@ const back = () => {
198198 currentDataTable .value = null
199199}
200200
201+ const loading = ref (false )
202+
203+ function startLoading() {
204+ loading .value = true
205+ }
206+ function endLoading() {
207+ loading .value = false
208+ }
209+
201210useEmitt ({
202211 name: ' ds-index-click' ,
203212 callback: back ,
204213})
205214 </script >
206215
207216<template >
208- <div v-show =" !currentDataTable" class =" datasource-config no-padding" >
217+ <div v-show =" !currentDataTable" v-loading = " loading " class =" datasource-config no-padding" >
209218 <div class =" datasource-methods" >
210219 <span class =" title" >{{ $t('ds.title') }}</span >
211220 <div class =" button-input" >
@@ -299,6 +308,8 @@ useEmitt({
299308 :type-name =" ele.type_name"
300309 :num =" ele.num"
301310 :description =" ele.description"
311+ @start-checking =" startLoading"
312+ @end-checking =" endLoading"
302313 @question =" handleQuestion"
303314 @edit =" handleEditDatasource(ele)"
304315 @recommendation =" handleRecommendation(ele)"
You can’t perform that action at this time.
0 commit comments