@@ -25,6 +25,7 @@ const columns = ref([] as string[])
25
25
const queryTip = ref (' ' )
26
26
const loadingStores = ref (true )
27
27
const showOverflowTooltip = ref (true )
28
+ const complexEditor = ref (false )
28
29
const dataFormat = ref (' table' )
29
30
const dataFormatOptions = [' table' , ' json' ]
30
31
const queryDataMeta = ref ({} as QueryDataMeta )
@@ -48,8 +49,10 @@ watch(store, (s) => {
48
49
case ' atest-store-elasticsearch' :
49
50
case ' atest-store-etcd' :
50
51
sqlQuery .value = ' *'
52
+ complexEditor .value = false
51
53
break
52
54
default :
55
+ complexEditor .value = true
53
56
queryDataMeta .value .currentDatabase = ' '
54
57
sqlQuery .value = ' '
55
58
}
@@ -296,7 +299,7 @@ watch(largeContent, (e) => {
296
299
</el-form-item >
297
300
</el-col >
298
301
<el-col :span =" 16" >
299
- <el-form-item >
302
+ <el-form-item v-if = " !complexEditor " >
300
303
<HistoryInput :placeholder =" queryTip" :callback =" executeQuery" v-model =" sqlQuery" />
301
304
</el-form-item >
302
305
</el-col >
@@ -328,6 +331,7 @@ watch(largeContent, (e) => {
328
331
</el-col >
329
332
</el-row >
330
333
</el-form >
334
+ <Codemirror v-model =" sqlQuery" v-if =" complexEditor" style =" height : 180px " />
331
335
</el-header >
332
336
<el-main >
333
337
<div style =" display : flex ; gap : 8px ;" >
@@ -336,7 +340,7 @@ watch(largeContent, (e) => {
336
340
<el-tag type =" primary" v-for =" label in queryDataMeta.labels" >{{ label.value }}</el-tag >
337
341
<el-check-tag type =" primary" :checked =" showOverflowTooltip" @change =" overflowChange" v-if =" queryResult.length > 0" >overflow</el-check-tag >
338
342
</div >
339
- <el-table :data =" queryResult" stripe v-if =" dataFormat === 'table'" height =" calc(100vh - 200px )" @cell-dblclick =" tryShowPrettyJSON" >
343
+ <el-table :data =" queryResult" stripe v-if =" dataFormat === 'table'" height =" calc(100vh - 380px )" @cell-dblclick =" tryShowPrettyJSON" >
340
344
<el-table-column v-for =" col in columns" :key =" col" :prop =" col" :label =" col" sortable :show-overflow-tooltip =" showOverflowTooltip" />
341
345
</el-table >
342
346
<Codemirror v-else-if =" dataFormat === 'json'" v-model =" queryResultAsJSON" />
0 commit comments