File tree Expand file tree Collapse file tree 3 files changed +24
-11
lines changed
Expand file tree Collapse file tree 3 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,6 @@ button {
6666 cursor : pointer ;
6767 transition : border- color 0.25s ;
6868}
69- button :hover {
70- border-color : #646cff ;
71- }
72- button :focus ,
73- button :focus-visible {
74- outline : 4px auto -webkit-focus-ring-color ;
75- }
7669
7770.card {
7871 padding : 2em ;
Original file line number Diff line number Diff line change 4949import { ref } from ' vue'
5050import { datasourceApi } from ' @/api/datasource'
5151import { encrypted , decrypted } from ' ./js/aes'
52+ import { ElMessage } from ' element-plus'
5253
5354const emit = defineEmits ([' refresh' ])
5455
@@ -141,6 +142,13 @@ const check = () => {
141142 }))
142143 datasourceApi .check (form .value ).then ((res : any ) => {
143144 console .log (res )
145+ if (res ) {
146+ ElMessage ({
147+ message: ' Connect success' ,
148+ type: ' success' ,
149+ showClose: true
150+ })
151+ }
144152 })
145153}
146154
Original file line number Diff line number Diff line change 33 <div class =" header" >
44 <div class =" mt-4" >
55 <el-input
6- v-model =" search "
6+ v-model =" searchValue "
77 style =" max-width : 300px "
88 placeholder =" Search Datasource..."
99 class =" input-with-select"
10+ clearable
11+ @change =" searchHandle"
1012 >
1113 <template #prepend >
1214 <el-icon ><Search /></el-icon >
@@ -52,9 +54,10 @@ import { datasourceApi } from '@/api/datasource'
5254import { datetimeFormat } from ' @/utils/utils'
5355import { ElMessageBox } from ' element-plus'
5456
55- const search = ref <string >(' ' )
57+ const searchValue = ref <string >(' ' )
5658const dsForm = ref ()
57- const dsList = ref <any >([])
59+ const dsList = ref <any >([])// show ds list
60+ const allDsList = ref <any >([])// all ds list
5861
5962const getStatus = (status : string ) => {
6063 if (status === ' Success' ) {
@@ -68,13 +71,22 @@ const getStatus = (status: string) => {
6871 }
6972}
7073
74+ function searchHandle() {
75+ if (searchValue .value ) {
76+ dsList .value = JSON .parse (JSON .stringify (allDsList .value )).filter ((item : any ) => {return item .name .toLowerCase ().includes (searchValue .value .toLowerCase ())})
77+ } else {
78+ dsList .value = JSON .parse (JSON .stringify (allDsList .value ))
79+ }
80+ }
81+
7182const refresh = () => {
7283 list ()
7384}
7485
7586const list = () => {
7687 datasourceApi .list ().then ((res ) => {
77- dsList .value = res
88+ allDsList .value = res
89+ dsList .value = JSON .parse (JSON .stringify (allDsList .value ))
7890 })
7991}
8092
You can’t perform that action at this time.
0 commit comments